cancel
Showing results for 
Search instead for 
Did you mean: 

How to redirect Printf to SWV Console in TrueStudio?

karthik.arunachalam
Associate II

I have followed step-by-step set up as explained in http://blog.atollic.com/cortex-m-debugging-real-time-variable-watch-using-swv/swo but it didnt work for me. I get sometimes some random characters printed on the SWV console.

My setup:

IDE: TrueStudio

Hardware: NUCLEO-F410RB

Programmer: On-board ST-Link

Let me know if you need further details.

18 REPLIES 18

Try testing more directly with ITM_SendChar()

Most common mode of failure is having the WRONG clock settings. ie Core and Trace settings disagree

Try using the VCP/USART to output SystemCoreClock.

Try using the SWV console in the ST-LINK Utilities.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
karthik.arunachalam
Associate II

I tried with ITM_SendChar directly, same issue still. My core clock is 96MHz, SWO clock is set to 1000kHz.

In Keil and ST-Link Utilities you'd need to set the Core clock as being 96 MHz, sorry not using Atollic.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
karthik.arunachalam
Associate II

This is how i am setting up the interface.

0690X000006CKIuQAO.png

Double check the SWO solder bridges on the board.

Check if the debug output is visible using ST-LINK Utilities SWV Window

Try running the board from the HSI directly, at 16 MHz, without the PLL, ie don't call SystemClock_Init()

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
karthik.arunachalam
Associate II

SWO solder bridge has 0 ohm installed.

i changed the clock source to internal, now its working. thanks for the suggestion. i need to find out why it is not working with external 6MHz crystal...

Probably because it's not actually running a 96 MHz.

You'd need to change the HSE_VALUE in stm32f4xx_hal_conf.h and the PLL settings in the SystemClock_Init(), and have everything coherent from hw/sw sides.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
karthik.arunachalam
Associate II

When i generate the code from CubeMX it takes care of that, right?

I suppose, but you're telling me things aren't working, what should I deduce?

Trust but Verify...

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..