Skip to main content
Visitor II
July 23, 2019
Question

How to enable SWO with OpenOCD + ST-Link?

  • July 23, 2019
  • 1 reply
  • 1782 views

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

    This topic has been closed for replies.

    1 reply

    Graduate II
    July 23, 2019

    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

    EMituAuthor
    Visitor II
    July 23, 2019

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