cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable SWO with OpenOCD + ST-Link?

EMitu
Associate II

How to enable SWO with OpenOCD + ST-Link? Is that possible with st-link v3 and STM32F407?

2 REPLIES 2

Well SWO/SWV does work with the ST-LINK/V3, one common issue is that it doesn't run at 2 MHz any more, so the bit/baud setting can be wrong with respect to the SYSCLK. On the L4+ board I seem to recall it using a 15 MHz data clock, and needing to set the core/clock dividers appropriately.

 printf("SWV %d\n", *((unsigned int *)0xE0040010)); // TPIU Async Clock Prescaler Register

*((unsigned int *)0xE0040010) = (SystemCoreClock / 15000000) - 1; // SWV Clock on ST-LINK/V3

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

Hmm, but with st-link GDB server 2MHz output is working. Trouble only with OpenOCD?