cancel
Showing results for 
Search instead for 
Did you mean: 

SWOTraces in debug for printf on SW4STM32

g. lewis
Associate II
Posted on April 11, 2017 at 11:50

I'd like to be able to output printf string on the Serial Wire Viewer window during the debug on SW4STM32. I've followed the tutorial in the in

Help >> Help Contents >> SystemWorkbench for STM32 User Guide >> Advanced >>SWOTraces.

But can find how to open the Serial Wire Viewer window.

Any help would be apreciated.

My board is the F411RE runing on windows10.

Generated the sw by the mean of STM32CUBEMX.

Placed into the    /* USER CODE BEGIN 3 */ the code:

      printf('it works');

but it doesn't...

6 REPLIES 6
Nesrine M_O
Lead II
Posted on April 11, 2017 at 14:56

Hi

lievre.gilles

,

Refer to this thread it may help you:

https://community.st.com/0D70X000006StxhSAC

-Nesrine-

Posted on April 11, 2017 at 18:23

I think he's asking about opening the SWV output window, not output via a USART on to a terminal.

I don't use SW4STM32, but it is likely a subview pane in the debugger, akin to the 'Memory View' or 'Stack View' in other tools. One could also confirm it is working using the ST-LINK Utilities, which provides a SWV Viewer. Make sure core frequency matches settings.

The other thread also had an issue where the system Hard Faulted dues to an unaligned 64-bit read due to the stack not being at the correct alignment.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on April 11, 2017 at 21:43

The tutorial showes this window but I can't get a hand on it:

0690X00000606k4QAA.png
Posted on April 11, 2017 at 22:06

That looks like the one from the ST-LINK Utilities. There is a tool-bar icon with 'SWV' in a terminal screen.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on April 12, 2017 at 09:36

I confirm there's no SWV plug-in in SW4STM32 and you should use the one in ST-LINK Utility software. 

Olivier GALLIEN
In order 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.
Posted on June 04, 2018 at 04:47

Hi, Olivier  GALLIEN

I develop STM32 in OSX system.There is no ST-LINK Utility software in OSX system, so I have no SWV to use.

What can i do for debugging via SWO in OSX system?

IDE:SW4STM32

DK:NUCLEO-F401RE

OS:OSX

Tools:ST-LINK2

Thanks a lot!