Skip to main content
Use the Monitor’s ITM/SWO connection for Cortex-M software stimulus messages. This path reads firmware output; it does not accept commands to the target.

Prepare

  1. Confirm that the MCU exposes ITM/SWO and the board routes SWO to the probe connector.
  2. Connect target ground, the debug interface, and SWO using the board and probe pinouts. A working SWD connection alone does not establish that SWO is wired.
  3. Install a compatible OpenOCD setup for the hardware host and probe. Select the exact OpenOCD target configuration.
  4. Build firmware that enables the trace path and writes to the intended ITM stimulus channels.
  5. Determine the CPU clock used while logging and the configured SWO rate.
A probe must support SWO capture through the selected OpenOCD setup. USB detection of an ST-Link or CMSIS-DAP probe alone does not establish board wiring or firmware support.

Configure and read

Select the ITM connection in a Serial tab. Set CPU MHz and SWO MHz to the firmware’s actual clocks. Both must be positive, and the SWO rate must not exceed the CPU clock. For a target that actually uses these clock values:
Connecting can start OpenOCD when no debugger server is running. If an existing debugger was started without ITM, ask Embedder to check its configuration before reconnecting; review the attachment precautions when target state matters.

Interpret the output

Channel 0 is shown as newline-terminated text with a ch0: prefix. Other stimulus channels appear as hexadecimal bytes with their channel number. Use the firmware’s channel definitions to interpret those bytes. This view does not provide a complete hardware-event or instruction trace. Structured event recording requires compatible firmware trace instrumentation; arbitrary text or other trace formats are not interchangeable. Use Coverage and trace for the available trace workflows.

Troubleshoot

  • OpenOCD target required: select a configuration for the exact MCU before connecting.
  • CPU frequency required or invalid: enter the active CPU clock and a valid SWO rate in MHz.
  • No ITM stream: check that the active OpenOCD setup enables ITM; an existing server without it must be reconfigured.
  • Connected but silent: verify SWO wiring, trace initialization, channel enablement, and that firmware is producing output.
  • Text is corrupt after a clock change: update the CPU and SWO settings to match the firmware.
  • Send is blocked: ITM is read-only; use UART or RTT for firmware input.
Last modified on September 12, 2026