13.2.6.6 Instrumentation Trace Macrocell (ITM)

The Instrumentation Trace Macrocell (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 by three different sources with several priority levels:

  • Software trace—Software can write directly to ITM stimulus registers. This can be done using the ‘printf’ function. For more information, see How to Configure the ITM.
  • Hardware trace—The ITM emits packets generated by the DWT.
  • Timestamping—Timestamps are emitted relative to packets. The ITM contains a 21-bit counter to generate the timestamp.