Skip to main content
Associate II
October 28, 2025
Question

ITM/SWV showing garbage values on STM32MP157F-DK2 (Cortex-M4)

  • October 28, 2025
  • 0 replies
  • 134 views

Hello everyone,

I’m using an STM32MP157F-DK2 board and trying to use one of the Cortex-M4 debugging features — ITM (Instrumentation Trace Macrocell).

However, I’m receiving garbage values on the SWV console, and I’m not sure why.

Here’s what I’ve done so far:

  • Edited the int _write() function in syscalls.c to redirect output to ITM

  •   Screenshot from 2025-10-28 11-26-24.png

  • Enabled Serial Wire Viewer (SWV) in the debug configuration.Screenshot from 2025-10-28 11-28-45.png

  • Set the core clock frequency in the debugger to match the MCU clock (as configured in the .ioc file).

These are the typical steps I follow to enable ITM output.

Is there anything else required to get correct SWV output?
Am I missing any configuration or initialization step specific to the STM32MP1 series?

Thanks in advance for any help or insights!