Keil Logo

TraceHalt

The TraceHalt command stops tracing when the expression tr_expr evaluates to TRUE. This command affects all trace data. Trace cannot be resumed through another tracepoint. The trace logic is reloaded when clicking RUN or after a GO command.

Syntax Description
TH tr_expr Stops capturing all trace data. The expression can specify a memory range.
_THDELAY_ = value Is a system variable to define a delay for the TraceHalt command. Set this variable to capture an additional amount of trace data after signaling a TraceHalt. The quantity of additional trace data depends on the trace channel:
  • ETB : Device-specific; depends on the ETB RAM width. In most cases, 4 Bytes.
  • ULINKpro: 4 Bytes.
Example: _THDELAY_ = 4

Examples:

TH  main                                   // Halt the trace when PC reaches main
TH  AD_last                                // Halt the trace when AD_Last is accessed
TH  _codeacc_(0x1400)                      // Halt the trace when PC reaches address 0x1400
TH  _readwriteacc_((0x8000,0xFF))          // Halt the trace when data memory in
                                           // range of 0x8000 - 0x80FF is accessed (read/write)
TH  \\Blinky\Blinky.c\47                   // Halt the trace when PC reaches line 47 in Blinky.c
TH   _writeacc_((0x8000,0xFF)) == 10       // Halt the trace when value 10 is written
                                           // to the address range of 0x8000 - 0x80FF
TH  !(_codeacc_((0x1400,0xFF)))            // Halt the trace when PC is outside
                                           // the code memory range of 0x8000 - x80FF
TH  main || __writeacc_((0x8000,0xFF))     // Halt trace if PC is at address main OR if
                                           // a write access to the memory range 0x8000 - 0x80FF occurs
TH  main && !(__readacc_((0x8000,0xFF)))   // Halt the trace if PC is at address main AND
                                           // there is no read access to range 0x8000 - 0x80FF
TH  main || LED_Init                       // Halt the trace if PC is at address main OR
                                           // at address LED_Init

TH  _codeacc_(0x14D0) && !(__readacc_(AD_Last) == 0x100)
                                           // Halt the trace if PC is at 0x14D0 and there is no
                                           // read access to AD_Last returning value 0x100
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.