cancel
Showing results for 
Search instead for 
Did you mean: 

Blackpill STM32F411CU6 lacking SWO Pin in SWD header => no SWV ITM printf ?

PRenn.1
Associate III

All clock setup and tracing enable checkbox checked and port0 selected but still no SWO printf debug messages in CubeIDE debugger.  Further research led to the SWO pin function (PB3) that deliveres the trace data from the board to the debugger. However Blackpill's SWD header only has four pins GND,Vcc,CLK,DIO, enough for firmware flashing, manual memory inspection but I fear not for SWO tracing .

Is my "analysis" correct, that the stock SWD header is per design not capable of SWO tracing?

ST-Link V2 only offers one additional pin (besides NRST) named SWIM on its 10-pin connector.
I assume that is not where PB3 ought be connected to, correct?

1 ACCEPTED SOLUTION

Accepted Solutions
PRenn.1
Associate III

so finally the dust settles:

1. all 10-pin ST-Link V2 gadgets in sleek aluminum casing are non-genuine,
lacking a lot of ST-Link's options, most prominently the TDO_SWO pin necessary for debug printf

2. to by able to debug a Blackpill using SWO one needs the huge soapbox ST-Link
and a wire from PB3 to TDO_SWO pin on the 20-pin header

3. old school alternatives like using USART or - as I did - USB_CDC as debug output device are available

4. still the parameters from the ST debug docs apply:
Clocks must match, TRACEEN must only be activated AFTER the configured clock (for example HSE) has stabilized.
(I presume that is what the click-on-.the-red-dot-in-debug-console is doing)

=> soapbox ST-Link is already ordered.

View solution in original post

7 REPLIES 7
Uwe Bonnes
Principal III

For https://stm32-base.org/boards/STM32F411CEU6-WeAct-Black-Pill-V2.0.html you can access SWO (JTDO)  as PB3 Header 2 pin 11. Or consider RTT.

Note that the Black (and other-coloured) Pills are not ST products, and are likely to have fake (non-ST) chips fitted.

 


@PRenn.1 wrote:

Is my "analysis" correct, that the stock SWD header is per design not capable of SWO tracing?


Yes but, as @Uwe Bonnes said, there's nothing to stop you accessing PB3 (and, thus, SWO) via other headers on the board.

AndrewNeil_0-1736772739393.png

 

You can, of course, also use a UART to give printf output ...

 


@PRenn.1 wrote:

ST-Link V2 only offers one additional pin (besides NRST) named SWIM on its 10-pin connector.


That's a fake (aka "clone") ST-Link, then:

https://community.st.com/t5/stm32-mcus/how-to-recognize-a-genuine-st-link-v2-versus-a-cloned-one/tac-p/703663/highlight/true#M965

 

A genuine ST-Link V2 has a 20-pin connector, and does include SWO:

AndrewNeil_1-1736763450318.png

https://www.st.com/en/development-tools/st-link-v2.html 

 

AndrewNeil_0-1736763294790.png

https://www.st.com/resource/en/user_manual/um1075-stlinkv2-incircuit-debuggerprogrammer-for-stm8-and-stm32-stmicroelectronics.pdf#page=12 

 

PS:

SWIM is only used by STM8 - not applicable to STM32.


@Uwe Bonnes wrote:

Or consider RTT.


It's good, but that will only work with Segger J-Link - not ST-Link.

Most Blackmagic  debug probe platforms also offer RTT, e.g. blackpill-f401cc, but not the platform using the STlink...


@Uwe Bonnes wrote:

Most Blackmagic  debug probe platforms also offer RTT


Can you elaborate on that?

AIUI, RTT is a Segger-proprietary thing, and only supported in J-Links (or onboard ST-Links which have been reprogrammed as J-Link) ?

 

PS:

Ah, I see the Black Magic debug probe has an "RTT":

https://black-magic.org/usage/rtt.html

Is that the same as Segger's RTT ?

 

either way, it wouldn't work with ST-Link (fake or otherwise) - which is what the OP mentions

PRenn.1
Associate III

so finally the dust settles:

1. all 10-pin ST-Link V2 gadgets in sleek aluminum casing are non-genuine,
lacking a lot of ST-Link's options, most prominently the TDO_SWO pin necessary for debug printf

2. to by able to debug a Blackpill using SWO one needs the huge soapbox ST-Link
and a wire from PB3 to TDO_SWO pin on the 20-pin header

3. old school alternatives like using USART or - as I did - USB_CDC as debug output device are available

4. still the parameters from the ST debug docs apply:
Clocks must match, TRACEEN must only be activated AFTER the configured clock (for example HSE) has stabilized.
(I presume that is what the click-on-.the-red-dot-in-debug-console is doing)

=> soapbox ST-Link is already ordered.


@PRenn.1 wrote:

2. to by able to debug a Blackpill using SWO one needs the huge soapbox ST-Link


Other, smaller, ST-link versions are available; eg, https://www.st.com/en/development-tools/stlink-v3mini.html

Other purveyors of SWO-capable debug probes are available.

 

Also, the signalling on SWO can be UART - so you could just use a UART to receive it:

https://community.st.com/t5/stm32-mcus-boards-and-hardware/uart-signal-on-swo-pin-from-st-link-v2-3/m-p/742817/highlight/true#M22588

 

PS

if you think the ST-Link is "huge", take a look at a J-Link!