English
Language : 

RM0316 Datasheet, PDF (1109/1141 Pages) STMicroelectronics – This reference manual targets application developers
RM0316
Debug support (DBG)
33.13
DWT (data watchpoint trigger)
The DWT unit consists of four comparators. They are configurable as:
• a hardware watchpoint or
• a trigger to an ETM or
• a PC sampler or
• a data address sampler
The DWT also provides some means to give some profiling informations. For this, some
counters are accessible to give the number of:
• Clock cycle
• Folded instructions
• Load store unit (LSU) operations
• Sleep cycles
• CPI (clock per instructions)
• Interrupt overhead
33.14 ITM (instrumentation trace macrocell)
33.14.1
General description
The ITM is an application-driven trace source that supports printf style debugging to trace
Operating System (OS) and application events, and emits diagnostic system information.
The ITM emits trace information as packets which can be generated as:
• Software trace. Software can write directly to the ITM stimulus registers to emit
packets.
• Hardware trace. The DWT generates these packets, and the ITM emits them.
• Time stamping. Timestamps are emitted relative to packets. The ITM contains a 21-bit
counter to generate the timestamp. The Cortex-M4®F clock or the bit clock rate of the
Serial Wire Viewer (SWV) output clocks the counter.
The packets emitted by the ITM are output to the TPIU (Trace Port Interface Unit). The
formatter of the TPIU adds some extra packets (refer to TPIU) and then output the complete
packets sequence to the debugger host.
The bit TRCEN of the Debug Exception and Monitor Control Register must be enabled
before you program or use the ITM.
33.14.2
Time stamp packets, synchronization and overflow packets
Time stamp packets encode time stamp information, generic control and synchronization. It
uses a 21-bit timestamp counter (with possible prescalers) which is reset at each time
stamp packet emission. This counter can be either clocked by the CPU clock or the SWV
clock.
A synchronization packet consists of 6 bytes equal to 0x80_00_00_00_00_00 which is
emitted to the TPIU as 00 00 00 00 00 80 (LSB emitted first).
A synchronization packet is a timestamp packet control. It is emitted at each DWT trigger.
DocID022558 Rev 5
1109/1141
1125