cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743 NUCLEO SWO printf debug issue

pej02
Associate
Posted on December 23, 2017 at 23:31

I'm trying and failing to get printf debug to output via SWO on a H743ZI-based Nucleo board. I've added retarget_io.c for STDOUT via ITM Port 0 in my Keil MDK v5.24a based project. I have the ST-LINK/V2 debugger firmware updated to v.2.29. I have trace enabled in the project->debugger settings and have tried all sorts of core clock settings from 400 MHz through 72 MHz to 8MHz. I get no debug printf output. I've also tried the ST-LINK Utility and see nothing via that route either.

I'm using the STM32Cube_FW_H7V1.1.0 firmware package and have modified the while (1) loop in main.c of the Examples->GPIO->GPIO_EXTI project to { HAL_Delay(500); printf ('i = %d\n', i++); } 

For sanity and to confirm the Nucleo 144 board schematic, I built an equivalent project for the F767ZI Nucleo board using the STM32Cube_FW_F7_V1.8.0. I could eventually see SWO printf output when I set the core clock to 72MHz (which is the same speed as the F103 MCU on the ST-LINK).

My hunch now is that one of the many clock domains on the H7 is not being set correctly in the clock configuration code. The SWO Trace Funnel (SWTF) looks to be worth investigating but I wanted to check if anyone else has solved this problem before I start investigating that?

1 ACCEPTED SOLUTION

Accepted Solutions
Posted on June 21, 2018 at 18:37

Tested solution is posted here :

https://community.st.com/0D50X00009nNBBHSA4

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

View solution in original post

2 REPLIES 2
Posted on December 23, 2017 at 23:50

Have it so you can use SWV and USART (VCP via ST-LINK) interchangeably. Make sure you have the hosting and retargeting code working. Use ITM_SendChar, you can also output via SWV and USART at the same time.

Read and output the SystemCoreClock, AHB and APB clocks via a printf(). Confirm things are correct. I also tend to clock clock sources and PLL settings. Output ITM/DWT registers, confirm those.

The Trace rate should match the core settings, the F1 speed has no relationship to the target frequency.

The CM7 has different locking of the ITM space compared to CM3/CM4 implementations

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 21, 2018 at 18:37

Tested solution is posted here :

https://community.st.com/0D50X00009nNBBHSA4

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