Orbcode Trace functions library
|
Use DWT to perform PC sampling and trace memory accesses. More...
Classes | |
struct | DWTOptions |
DWT configuration. More... | |
Enumerations | |
enum | DWTSyncTap { DWTSyncTapDisabled = 0 , DWTSyncTap24 = 1 , DWTSyncTap26 = 2 , DWTSyncTap28 = 3 } |
Interval of ITM synchronization packet. More... | |
enum | DWTCycleTap { DWTCycleTap6 = 0 , DWTCycleTap10 = 1 } |
Interval of PC sampling and event counter packets. More... | |
Functions | |
static void | DWTSetup (const DWTOptions *options) |
Configures DWT component. More... | |
static void | DWTEnableComparator (uint8_t comparator, uintptr_t address, uint8_t ignoreBits, bool emitRange, uint8_t function) |
Configures DWT comparator. More... | |
static void | DWTDisableComparator (uint8_t comparator) |
Disables DWT comparator. More... | |
Use DWT to perform PC sampling and trace memory accesses.
Data Watchpoint & Trace unit provides built-in capabilites for:
DWT outputs data to ITM which forwards it to formatter. When configuring ITM option ITMOptions::ForwardDWT must be enabled.
Reference: ARMv7-M Architecture Reference Manual, chapter C1.8 The Data Watchpoint and Trace unit
enum DWTSyncTap |
Interval of ITM synchronization packet.
See ARMv7-M Architecture Reference Manual, section C1.8.3 "CYCCNT cycle counter and related timers" for details
enum DWTCycleTap |
Interval of PC sampling and event counter packets.
See ARMv7-M Architecture Reference Manual, section C1.8.3 "CYCCNT cycle counter and related timers" for details
|
inlinestatic |
Configures DWT component.
Note that there is no validation if specified configuration is valid (e.g. sampling prescaler values) and there are no checks to verify MCU capabilities (enabling exception tracing when it is not implemented).
options | DWT configuration |
|
inlinestatic |
Configures DWT comparator.
Comparator might issue a trace packet when specified memory range is accesses for read or write.
Number of comparators is vendor-specific, check with documention how many are available. This function does not check if specified comparator is available.
Comparator can monitor single byte in memory or range by ignoring specified number of least significant bits, e.g. to monitor single uint32_t variable setup address
parameter to variable address and ignoreBits
parameter to 2
comparator | Comparator to use |
address | Watchpoint base address |
ignoreBits | Number of bits to ignore |
emitRange | If true, DWT will emit packet with actual data access address. if false - packet with program counter that resulted in memory access. |
function | Comparator function, see ARMv7-M Architecture Reference Manual, table C1-14 for list of available functions |
|
inlinestatic |
Disables DWT comparator.
Number of comparators is vendor-specific, check with documention how many are available. This function does not check if specified comparator is available.
comparator | Comparator to disable |