trice

module
v0.63.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2024 License: MIT

README

TriceGirlS.png Trice <- TRace Ids C Embedded

github.io/trice/

GitHub issues GitHub All Releases GitHub code size in bytes GitHub watchers GitHub release (latest by date) GitHub commits since latest release Go Report Card PRs Welcome test Coverage Status

Log in (a) trice (S>G)

even inside ↯ interrupts in less than 1 µs❗

About

  • Replace printf or log in C-code for getting:
    • Speed, to be usable also inside interrupts,
    • Space, to reduce needed FLASH memory size,
    • Features delighting the developers heart.
  • Main idea: Logging strings not into an embedded device to display them later on a PC but keep usage comfortable and simple.
  • Trice consists of 2 parts:
    1. C code TRICE macros generating tiny & super-fast embedded device real-time trace/log code
    2. Tool trice for managing and visualization.
      • Written in Go and therefore usable on all platforms Go supports.
      • You can also use your own environment to receive the Trice packages, exchange the carried IDs with the format string and print out.
  • Trice User guide

Possible Use Cases

  • Using Trice not only for printf debugging but also as logging technique is possible and gives the advantage to have very short messages (no strings) for transmission, but keep in mind that the file til.json is the key to read all output if your devices in the field for 10 or more years.
    • Optionally add til.json as a (compressed) resource to your target image. One possibility is using SRecord. Or simply provide a download link.
  • You can see Trice also as a kind of data compression what could be interesting for IoT things, especially NB-IoT, where you have very low data rates.
  • Storing Trice messages in FLASH memory for later log analysis saves memory because a typical TRICE occupies only 4 bytes independently of the format string length plus optional values.
  • Also, it is possible to encrypt the Trice transfer packets to get a reasonable protection for many cases.
    • This way you can deliver firmware images with encrypted Trice output, only readable with the appropriate key and til.json.
    • XTEA is implemented as one option.
  • You can even translate the til.json file in different languages, so changing a language is just changing the til.json file without touching the target binary.
  • With Trice it is easy to do timing analysis on distributed embedded systems. Host and target timestamps are supported.

How it approximately works (UART example)

This slightly simplified view is explained here

trice

Data Transfer

Display server option

Start trice ds inside a console, option: third_party/alacritty, locally or on a remote PC and connect with several trice tool instances like with trice log -p COM15 -ds for example.

Documentation

Support?

Yes please - or simply ⭐ it. ☺

Cloning the repo:

git clone https://github.com/rokath/trice.git

Similar projects

Debugging using VS-Code and Clang for a Trice-instrumented Project in Direct-Out Mode over SEGGER-RTT

(See folder ./examples for more details.)

x

Directories

Path Synopsis
cmd
cui
internal
args
Package args implements the commandline interface and calls the appropriate commands.
Package args implements the commandline interface and calls the appropriate commands.
charDecoder
Package charDecoder provides a decoder char encoded trice streams.
Package charDecoder provides a decoder char encoded trice streams.
com
Package com reads from COM port.
Package com reads from COM port.
decoder
Package decoder provides several decoders for differently encoded trice streams.
Package decoder provides several decoders for differently encoded trice streams.
do
dumpDecoder
Package dumpDecoder provides a decoder dumping encoded trice stream.
Package dumpDecoder provides a decoder dumping encoded trice stream.
emitter
Package emitter emits the translated trice strings.
Package emitter emits the translated trice strings.
id
Package id List is responsible for id List managing
Package id List is responsible for id List managing
keybcmd
Package keybcmd is responsible for interpreting user commandline and executing commands
Package keybcmd is responsible for interpreting user commandline and executing commands
link
Package link reads from SeggerRTT with the SEGGER app JLinkRTTLogger or with the open source app stRttLogger.exe.
Package link reads from SeggerRTT with the SEGGER app JLinkRTTLogger or with the open source app stRttLogger.exe.
pkg
ant
package ant performs a function of type Processing on each file in several files, folders and sub-folders.
package ant performs a function of type Processing on each file in several files, folders and sub-folders.
cipher
Package cipher provides an encryption and decryption interface.
Package cipher provides an encryption and decryption interface.
endian
Package endian provides an architecture agnostic value describing the native endianness on the local machine.
Package endian provides an architecture agnostic value describing the native endianness on the local machine.
msg
Package msg provides common message functions.
Package msg provides common message functions.
tst
Package tst provides some helper functions for testing.
Package tst provides some helper functions for testing.
test
doubleBuffer_deferred_multi_cobs
Package cgot is a helper for testing the target C-code.
Package cgot is a helper for testing the target C-code.
doubleBuffer_deferred_multi_tcobs
Package cgot is a helper for testing the target C-code.
Package cgot is a helper for testing the target C-code.
doubleBuffer_deferred_multi_xtea_cobs
Package cgot is a helper for testing the target C-code.
Package cgot is a helper for testing the target C-code.
doubleBuffer_deferred_single_cobs
Package cgot is a helper for testing the target C-code.
Package cgot is a helper for testing the target C-code.
doubleBuffer_deferred_single_tcobs
Package cgot is a helper for testing the target C-code.
Package cgot is a helper for testing the target C-code.
doubleBuffer_direct_noRouting_nopf
Package cgot is a helper for testing the target C-code.
Package cgot is a helper for testing the target C-code.
doubleBuffer_twin_direct_noRouting_nopf_deferred_multi_cobs
Package cgot is a helper for testing the target C-code.
Package cgot is a helper for testing the target C-code.
ringBuffer_deferred_cobs
Package cgot is a helper for testing the target C-code.
Package cgot is a helper for testing the target C-code.
ringBuffer_deferred_tcobs
Package cgot is a helper for testing the target C-code.
Package cgot is a helper for testing the target C-code.
ringBuffer_deferred_xtea_cobs
Package cgot is a helper for testing the target C-code.
Package cgot is a helper for testing the target C-code.
stackBuffer_cobs
Package cgot is a helper for testing the target C-code.
Package cgot is a helper for testing the target C-code.
stackBuffer_nopf
Package cgot is a helper for testing the target C-code.
Package cgot is a helper for testing the target C-code.
stackBuffer_tcobs
Package cgot is a helper for testing the target C-code.
Package cgot is a helper for testing the target C-code.
staticBuffer_cobs
Package cgot is a helper for testing the target C-code.
Package cgot is a helper for testing the target C-code.
staticBuffer_nopf
Package cgot is a helper for testing the target C-code.
Package cgot is a helper for testing the target C-code.
staticBuffer_tcobs
Package cgot is a helper for testing the target C-code.
Package cgot is a helper for testing the target C-code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL