2018-11-06 08:22 AM
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.
2018-11-06 08:26 AM
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.
2018-11-06 08:35 AM
I tried with ITM_SendChar directly, same issue still. My core clock is 96MHz, SWO clock is set to 1000kHz.
2018-11-06 09:19 AM
In Keil and ST-Link Utilities you'd need to set the Core clock as being 96 MHz, sorry not using Atollic.
2018-11-06 09:23 AM
This is how i am setting up the interface.
2018-11-06 09:30 AM
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()
2018-11-06 09:36 AM
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...
2018-11-06 09:55 AM
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.
2018-11-06 10:09 AM
When i generate the code from CubeMX it takes care of that, right?
2018-11-06 10:12 AM
I suppose, but you're telling me things aren't working, what should I deduce?
Trust but Verify...