cancel
Showing results for 
Search instead for 
Did you mean: 

SWV on the STM32F746ZG

Luka Mesaric
Associate II
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
4 REPLIES 4
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
Up vote any posts that you find helpful, it shows what's working..
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 II
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.

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.