Debugger Features
User Guide
© 2023 Microchip Technology Inc. and its subsidiaries
DS-50003529B - 50
5.4 ARM ITM/SWO Trace
ITM trace outputs UART-format data using the single-pin SWO. ITM has the provision to send this
data over multiple ports available from 0 to 31. Details of ITM/SWO trace may be found in the
following topics.
Not all SAM devices have ITM trace. See in MPLAB X IDE Help>Release Notes> Debug Features
Support>Hardware Tool Debug Features by Device.
5.4.1 How ITM Trace Works
All SAM MCUs/MPUs that support ITM trace are Arm
®
Cortex
®
-M processor-based devices with Arm
®
CoreSight
®
architecture. Currently ITM is supported in Cortex M3, M4, M33, and SC300 cores.
The CoreSight Instrumentation Trace Macrocell (ITM) block is a software application driven trace
source. Supporting user code generates SoftWare Instrumentation Trace (SWIT). In addition, the block
provides a coarse-grained timestamp functionality. The main uses for this block are to:
• support printf style debugging.
• trace OS and application events.
• emit diagnostic system information.
MPLAB ICD 5 is capable of streaming UART-format ITM trace to the host computer. Trace is captured
on the TRACE/SWO pin of the 10-pin header (JTAG TDO pin). Data is buered internally on the
MPLAB ICD 5 and is sent over the trace interface to the host computer.
Note: You can set the ITM baud rate in MPLAB X IDE. See 5.4.5.4. Setup ITM Trace.
Figure 5-1. ITM Block Diagram
The ITM contains the following sub-blocks:
Timestamp Generates timestamp packet.
Sync control ITM synchronizer.
Arbiter Arbitrates between synchronous, timestamp, and SWIT packet.
FIFO ATB First In First Out (FIFO).
Emitter ATB registered emitter.
Data is written to the stimulus registers using the APB interface. This data is then transmitted on the
ATB interface as SWIT packets .
5.4.2 How SWO Works with ITM Trace
The CoreSight Serial Wire Output (SWO) is a trace data drain that acts as a bridge between the
on-chip trace data to a data stream that is captured by a Trace Port Analyzer (TPA) which is the MPLAB
ICD 5 In-Circuit Debugger.
Compared to the Trace Port Interface Unit (TPIU), the SWO contains:
• no formatter.
• no pattern generator.