cancel
Showing results for 
Search instead for 
Did you mean: 

SWO Viewer STM32F401/411 Nucleo problem

tm3341
Associate II
Posted on December 26, 2014 at 17:47

Hi to all,

I have F401 and F411 Nucleo boards.

Both boards have STLink version ''V2.J23.M7 STM32 Debug+Mass storage'' installed.

However, SB15 is connected, so STLink and PB3 pin (SWO) are connected.

If I open STLink and click on ''Print via SWO Viewer'', nothing happen.

My first thought was that my program is failed.

I took my discovery board (F429) and connect discovery board via SWD pins to nucleo (F429 acts as programmer/debugger) and everything started working, so program is OK written and SWO output is enabled.

So my figure is that problem is STLink on nucleo boards.

Also, when I do trace on Keil, I got error (in command line) when debug, saying ''Cannot access memory'' but program is working just five using STLink on F429 discovery or external Keil ULINK2 programmer.

On mbed.org they said that everything works perfect on their boards, but I can't get it in working state.

Any ideas would be great

#printf #swd #swo #nucleo-f401re-swd-printf-use-sw #nucleo
14 REPLIES 14
Posted on December 26, 2014 at 18:39

If I open STLink and click on ''Print via SWO Viewer'', nothing happen.

Is the frequency matching what the board is running at? Is it possible you're got something shorted?

Do you see this with more than one Nucleo board? Does the problem exhibit with older firmware?

Will see if I have a 401 Nucleo to hand...
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
tm3341
Associate II
Posted on December 26, 2014 at 19:06

Frequency matches, like I said, it works with external debugger (F429-Disco and ULINK2).

Also, if I test the same firmware but 180MHz on F429-Disco, there it works without need for external debugger. The same is with F4-Discovery.

On F401 and F411 does not work. I think that problem is with VCP+Mass storage feature here, don't know.

It never worked for me, neighter with 2.21 version.

No idea what is going on here.

When I open STLink SWO viewer and hit Start, after 2-3 seconds I got Warning, saying ''Disconnected from SWV Trace port!''.

Image attached.

________________

Attachments :

stlink-swv-trace.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0eh&d=%2Fa%2F0X0000000bc1%2Folesck5wAJe8BAB4mGZw_MxugU1YjhMvOMKWaMhfTho&asPdf=false
sunphoenixt
Associate II
Posted on January 23, 2015 at 06:02

Hi,majerle.tilen

Hardware:Nucleo-F401RE +8Mhz external     Software:MDK-ARM+STM32F4xx_DSP_StdPeriph_Lib_V1.4.0

I readed one discussion on website ''http://stm32f4-discovery.com/2014/12/library-46-debug-stm32f4-device-swo-feature/#more-1927'',

the autor's test result is

''

I’ve tested this feature on some boards:

    STM32F429-Discovery: worked without any problem, SB9 solder bridge required before to be soldered

    STM32F4-Discovery: worked without any problem

    STM32-Nucleo:

        F401: didn’t worked, I always got error that memory cannot be read, but physical connection is there by default

        F411: didn’t worked, I always got error that memory cannot be read, but physical connection is there by default

''

and my Nucleo-F401RE can't use SWV at first either.

but after read all the discussions on this page,I realized maybe it's the swv clock setting didn't match the trace setting as Clive1 mentioned.

So I check the system_stm32f4xx.c and find out the default clock setting isn't 84Mhz,then I changed PLL_M=4 PLL_N=168 PLL_P=4.

then recompiled and downloaded,the swv started to work properly.

johan23
Associate
Posted on May 21, 2015 at 16:05

I can confirm that 

V2.J23.M9

is not working with SWO on Nucleo-F401. However when I tried the same board with an external ST-link dongle it worked. So it seems like the SWO support is not stable between versions on the Nucleo ST-link. 

Posted on May 21, 2015 at 17:06

V2.JM10 works just fine, don't have M9, care to attach?

My Nucleo's have shorting resistors at SB15 (SWO)

________________

Attachments :

stlink_v2j23m10.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0CK&d=%2Fa%2F0X0000000bc0%2FGPlKT4hTMrOQ9zgkWggRcDlSgn1G0PPnptVw8MuyjDM&asPdf=false

SWV-NUCLEO-F401RE.hex : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0eX&d=%2Fa%2F0X0000000bby%2Frh69YoMf0qvkrpObt070YBeKlmRvC4MGaVXiifTeZaY&asPdf=false
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
tm3341
Associate II
Posted on December 29, 2014 at 08:10

I've made test again with new F411 Nucleo..still not working

''Cannot access memory'' in Keil uVision, in ST-Link Utility is nothing happen.
Posted on December 29, 2014 at 09:59

Can't this be a driver problem on the PC side?

JW

Posted on December 29, 2014 at 10:00

[sorry double post]

tm3341
Associate II
Posted on December 29, 2014 at 13:14

It works with external debugger, so program is OK and is working.

Via ST-Link on nucleo board it does not work for some reason.

I have no idea what's going on.

On F4 and F429-Discovery it works just great!