Skip to main content
Luka Mesaric
Associate
June 12, 2018
Question

SWV on the STM32F746ZG

  • June 12, 2018
  • 4 replies
  • 2142 views
Posted on June 12, 2018 at 08:31

Hi, I am trying to enable the SWV on the STM32F746ZG, but without success. I generated the code with CUBEMX (enabled the Trace asynchronous SW) and in debugger configuration configured interface SWD, and trace SWV (with core clock at 200MHz). I have also configured the trace configuraton in debugger, but when i click start trace, no data is shown. In the console window I get verify failed message. I am using J-Link.

#swv
    This topic has been closed for replies.

    4 replies

    Tesla DeLorean
    Guru
    June 12, 2018
    Posted on June 12, 2018 at 16:10

    Your board, or something else. Make sure PB3 (SWO) is connected properly, check solder-bridges on NUCLEO/DISCO boards.

    Check the actual speed, use a USART to output internal stats until you get SWV working.

      printf('HCLK=%d\n', HAL_RCC_GetHCLKFreq());

      printf('APB1=%d\n', HAL_RCC_GetPCLK1Freq());

      printf('APB2=%d\n', HAL_RCC_GetPCLK2Freq());
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Luka Mesaric
    Associate
    June 12, 2018
    Posted on June 12, 2018 at 17:22

    Hello Clive,

    Thank you very much for your reply. I already checked the sb - it is soldered (the board is NUCLEO). The speeds also: HCLK:200Mhz, PCLK1:50Mhz, PCLK2:100MHz.

    I managed to get some data with core clock set to 100Mhz (actual clock is 200) in the debugger conf, but the data is incorrect, which makes me believe that swo clock is not configured properly? (I am sending data with ITM_SendChar(0) but receiving non constant data)

    I could not find where to set manualy via register the swo clock. Shouldn't there be an options for that?

    Luka Mesaric
    Associate
    June 13, 2018
    Posted on June 13, 2018 at 09:04

    Update: I set the system clock  -> HSI (16 MHz) and now everything works fine. Will have to find out why doesn't work with 200 MHz.

    Luka Mesaric
    Associate
    June 13, 2018
    Posted on June 13, 2018 at 11:00

    Ok. Found the error. I had the input frequency for HSE set to 25 MHz (from previous project with different board but same proc), but upon looking at the schematic it shows that this board has 8 MHz oscillator. Everything works as it should now.