Skip to the content.

Troubleshooting and Limits

Contents

Start with the UM’s first checks. For generated-header errors use Bind diagnostics. This chapter covers deeper transfer checks and shared call limitations.

1. Initial Data Transfer Setup Hints

For a raw-byte diagnostic, the following uses a deliberately fixed numeric ID. Collect this explicit-ID specimen into a matching TIL with trice add; it is not the normal Bind application pattern. Do not add it to an already bound source file.

triceConfig.h:

#define TriceStamp32 0x44434241 // a fixed value

#define TRICE_DIRECT_OUT_FRAMING TRICE_FRAMING_NONE   // disable framing for this diagnostic
#define TRICE_DEFERRED_OUT_FRAMING TRICE_FRAMING_NONE // no framing to interpret the byte stream manually

main.c:

int main( void) {
    // system init...
    TriceInit();
    TRice(iD(170), "Fun %x!\n", 0xadded ); // with "fixed" iD(170), 32-bit stamp, and with `\n`
    TriceTransfer(); // call cyclically for deferred mode
    // system run ...
}
trice log -s -port com1 -pf none -v -ts32="att:%08x fix" # enter this (adapted)
#       /-------------------------------------- ID low byte (170)
#       |  /----------------------------------- ID high byte (6 bits=0) with 2 most significant bits set (32-bit stamp follows)
#       |  |       /--------------------------- 32-bit (time) stamp
#       |  |       |      /-------------------- initial cycle counter: 192
#       |  |       |      |  /----------------- payload size
#       |  |       |      |  |       /--------- payload (0x00added) 
#       |  |       |      |  |       |      / - 0-delimiter or next Trice
#       |  |       |      |  |       |      |
#       v  v  vvvvvvvvvvv v  v  vvvvvvvvvvv v
# Input(aa c0 41 42 43 44 c0 04 ed dd 0a 00 ... ) # expected byte stream
# ...
#              main.c    84 44434241 fix   170 Fun added!
# ...

2. Short Trouble Shooting Hints

Problem Hint
Missing objcopy in macOS brew install binutils
Small GUI Editor for macOS brew install cotedit Usage: cot (not as root)
Small In-Terminal Editor Linux https://cte.e10labs.com/, tilde, micro, joe, https://craigbarnes.gitlab.io/dte/ (also as root)
Nothing shown with trice log -s Check that format strings end with \n and/or use -addNL

3. Cycle Counter

4. Permanent Limitations

4.1. Limitation TRICE in TRICE not possible

int f0( void ){ TRICE( "msg:f0\n"); return 0; }
void f1( void ){ TRICE( "No; %d", f0() ); }

f1() creates the “No” record header, then evaluates f0(), which emits another record before the “No” tail is written. The interleaved records corrupt the output despite successful compilation.

int f0( void ){ TRICE( "msg:f0\n"); return 0; }
void f1( void ){ int x = f0(); TRICE( "Yes: %d", x ); }

5. Source syntax and workflow limits

Bind, Insert and CE have different rules for several calls on one line and calls inside wrappers. Use the support tables rather than assuming one rule for all workflows. Bind limits also cover compiler requirements and generated includes.

Trice scans source text rather than running the C preprocessor. Write a complete supported literal format at the log site; do not rely on token pasting to build it. For example, TRICE("msg:" ## "Hello\\n") is not a supported way to specify a format. Historical Insert parser examples are retained in the legacy reference.

6. Argument limits

Scalar calls have at most twelve values of one selected width. For larger data use buffer macros. Floats need aFloat(); doubles need aDouble() and a 64-bit macro. Runtime strings use triceS or triceN. Full examples and supported formats are in Writing Trice Messages.