Skip to main content
Associate
Mar 26, 2026 11:06 AM UTC
Solved

NUCLEO-L452 STLink debugging external MCU using SWO

What could be the reason that configuring in CubeIDE SWV as enabled the MCU on debug flashes and stops responding? Flashing works fine both ways, SWO is connected.

 

Time elapsed during verifying operation: 00:00:00.082

Download verified successfully

Target is not responding, retrying...

Shutting down...

 

Failed to read registers from target

Error: Failed to set breakpoint at address: 0x80005c0.

Error: Failed to set more breakpoints

Failed to read all registers from target

External target MCU is STM32L412. STLink is upgraded to the latest version.
Since flashing works, SWD is connected properly.
MCU is configured as trace asynchronous Sw and there are no reconfiguration of SWD pins.

 

 

KaLiOBest answer
Associate
Mar 26, 2026 1:23 PM UTC

The STLink receives power from 5V USB and the target from a power supply. Grounds are connected and flashing the target works with or without power sense pin.

Just now tested with L0538-DISCO and external printf works. CubeProgrammer correctly sees 3.3V line, meaning the STLink mcu on nucleo (F1 series chip) is partially damaged, as it can debug the internal L4 mcu correctly with ITM, but can't do external mcu ITM debugging (not sure why would that even work, as the SWD lines trace to the same pins). At least it semi works...

2 replies

TDK
Mar 26, 2026 12:21 PM UTC

As detailed in your other post, this may be related to using CN5 pin 1 as power. You should provide power through some other means.

Solved: NUCLEO L4 ST-LINK flashing external board - STMicroelectronics Community

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
KaLiOAuthorBest answer
Associate
Mar 26, 2026 1:23 PM UTC

The STLink receives power from 5V USB and the target from a power supply. Grounds are connected and flashing the target works with or without power sense pin.

Just now tested with L0538-DISCO and external printf works. CubeProgrammer correctly sees 3.3V line, meaning the STLink mcu on nucleo (F1 series chip) is partially damaged, as it can debug the internal L4 mcu correctly with ITM, but can't do external mcu ITM debugging (not sure why would that even work, as the SWD lines trace to the same pins). At least it semi works...