Instrumentation Trace Macrocell (ITM)

ITM provides a memory-mapped register interface to allow applications to write logging/event words to the optional external Trace Port Interface Unit (TPIU). ITM is an optional application-driven trace source that supports printf style debugging to trace operating system and application events, and generates diagnostic system information.

ITM also supports control and generation of timestamp information packets. The event words and timestamp information are formed into packets and multiplexed with hardware event packets from DWT.

Note: In order to collect ITM trace, DWT must be enabled. This is because sync packet is not sent when ITM is enabled, the DWT cycle counter function must be used to generate the sync packet before writing any stimulus registers. This mechanism does not effect ETM trace in any way.
Note: If you collect ITM trace through TPIU (that is not using ETB buffer), you may lose ITM packets when ITM trace throughput is very high, especially when the executed code includes many branches with less sequential instructions and there is a lot of ETM trace generating. Since ETM has higher priority than ITM and when the trace generation exceeds the trace port bandwidth, the trace with the smaller priority is lost. To ensure enough bandwidth for ITM trace, disable ETM and ITM profiling counters and collect only ITM instrumentation trace with stimulus register 1.

ITM supports Timestamps and Synchronization.