Skip to main content
EMitu
Associate III
Jul 23, 2019 6:34 PM UTC
Question

How to enable SWO with OpenOCD + ST-Link?

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

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
Jul 23, 2019 7:04 PM UTC

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
EMitu
EMituAuthor
Associate III
Jul 23, 2019 7:16 PM UTC

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