cancel
Showing results for 
Search instead for 
Did you mean: 

SWV works with NUCLEO-144 USB ST-LINK but not with external ST-LINK/V2

JuiHung
Associate II

Hi,

I’m using a NUCLEO-144 (STM32H563ZIT6) development board with only the board USB STLINK-V3EC port connected. TRACE and DEBUG are enabled with Serial Wire in the configuration file, and printf is routed through ITM:

int _write(int file, char *ptr, int len) {
  for (int i = 0; i < len; i++) {
    ITM_SendChar((*ptr++));
  }
  return len;
}

SWV is enabled in the debug configuration, the core clock is 250 MHz, and the SWV window (port 0) shows output correctly in STM32CubeIDE.

 

JuiHung_2-1773711147297.png

 

When I switch to an external ST-LINK/V2 and connect

JuiHung_3-1773711322216.png

NRST#15 / SWDIO#7 / SWCLK#9 / GND#20 / TARGET VCC#1 / VDD3.3 V#19, programming and debugging work, but the SWV window shows nothing in the STM32CubeIDE.

The reason for using ST-LINK/V2 for SWV debugging is that on our product’s onboard MCU, only VDD, NRST, SWDIO, SWCLK, and GND are exposed.

 

Could anyone explain why SWV output does not appear with ST-LINK/V2?

Thanks.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

It turns out that the ST-LINK pin short needs to be removed from the power source select jumper JP2 on NUCELO-144. After removing it, the SWV output works correctly when STLINKV/2 SWO is connected to CN12-Pin #31.

JuiHung_0-1773818643154.png

View solution in original post

6 REPLIES 6
FBL
ST Employee

Hi @JuiHung 

On the 20‑pin JTAG/SWD header of ST‑LINK/V2, SWO is pin 13. Check user manual.

On nucleo board, SWO should be on the MCU pin mapped to PB3. 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.




Best regards,
FBL
Andrew Neil
Super User

Have you checked that the onboard ST-Link is disconnected (particularly from SWO) when you're using the external ST-Link ?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

It didn’t disconnect, but I didn’t connect SWO. I will check by connecting it to the board to see if I can get the output.
Thanks.

Hi FBL,

 

Thanks for the reply.

I have reconfigured the DEBUG mode from Serial Wire to Trace Asynchronous SW, which enables PB3 and regenerated the code.

JuiHung_0-1773800389510.png

JuiHung_1-1773800923108.png

 

I first tested with the USB ST-LINK port on the NUCLEO-144 board, and ITM_SendChar worked via SWV in STM32CubeIDE. Then I switched to ST-LINK/V2 and added an extra connection between Pin #13 on ST-LINK/V2 and PB3 on CN12-Pin #31 or CN7-Pin#15 on Nucleo-144 board, but the SWV output still does not show.

Is there anything I might be missing?

Thanks.

It turns out that the ST-LINK pin short needs to be removed from the power source select jumper JP2 on NUCELO-144. After removing it, the SWV output works correctly when STLINKV/2 SWO is connected to CN12-Pin #31.

JuiHung_0-1773818643154.png


@JuiHung wrote:

but the SWV output still does not show.


So you need to un-mark that post as the solution - because it does not solve the problem!

Then please mark the solution on the post which did solve it (not this one!)

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.