Skip to main content
Use ITM over SWO to read software stimulus messages from a Cortex-M target. This connection is read-only: it shows firmware output and doesn’t send input to the target. Use UART or RTT when you also need to send commands.

Prepare

  1. Confirm that the MCU exposes ITM/SWO and that 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 doesn’t show that SWO is wired.
  3. Install OpenOCD on the computer running Embedder.
  4. Connect a supported SWO probe to that computer: ST-Link/V1, ST-Link/V2, ST-Link/V2-1, ST-Link/V3, DAPLink, NXP LPC-Link2, or NXP MCU-Link.
  5. Build firmware that enables the trace path and writes to the ITM stimulus ports you plan to read. End each channel 0 text line with \n.
  6. Note the CPU clock while the firmware logs, and the SWO rate it configures.
The ITM entry appears in the Port list only when OpenOCD is installed and one of these probes is connected. The entry shows the probe name followed by ITM, such as ST-Link/V2-1 ITM. A listed entry doesn’t confirm the board’s SWO wiring or the firmware’s trace setup.

Configure and connect

  1. Open a Serial Monitor tab. See Open a Serial Monitor tab.
  2. Select the ITM entry in Port.
  3. Select Target and choose the OpenOCD target configuration for your MCU, such as stm32f4x. A star marks the suggested target.
  4. Enter CPU MHz. It has no default.
  5. Enter SWO MHz. The default is 2.
  6. Select Connect.
Both clock values must be greater than 0, and the SWO rate can’t exceed the CPU clock. Use the clocks the firmware actually runs at. If no debugger server is running, connecting starts OpenOCD with ITM enabled, and the tab shows Starting OpenOCD with ITM.... If a debugger server is already running without ITM, the connection fails; stop that server and connect again. Review the attachment precautions when target state matters. You can also ask Embedder to capture ITM output. Give the clocks and target that match your firmware:
To capture boot output, give Embedder a probe reset command. DTR and RTS resets don’t apply to ITM.

Interpret the output

The view shows only software stimulus output. It doesn’t show ITM timestamps or hardware trace, such as DWT event counters, exception trace, PC sampling, or data trace, so it isn’t a complete event or instruction trace. See Coverage and trace for the trace workflows Embedder supports.

Troubleshoot

  • No ITM entry in Port: install OpenOCD and connect a supported probe to the computer running Embedder.
  • Target can’t be selected: no supported SWO probe is detected.
  • Configure OpenOCD target to use ITM: choose a Target before you connect.
  • Enter CPU frequency to use ITM: enter the active CPU clock in CPU MHz.
  • SWO must not exceed CPU frequency: lower SWO MHz or correct CPU MHz.
  • ITM port not available. Ensure OpenOCD is configured for ITM.: a debugger server is running without ITM. Stop it, then connect again.
  • Connected but silent: check SWO wiring, trace initialization, enabled stimulus ports, and that the firmware is producing output.
  • Channel 0 text is missing its last line: the firmware hasn’t sent the final \n.
  • Text is corrupt after a clock change: update CPU MHz and SWO MHz to match the firmware.
  • No send box: ITM is read-only. Use UART or RTT for firmware input.
Last modified on October 13, 2026