2017-12-23 02:31 PM
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?
Solved! Go to Solution.
2018-06-21 09:37 AM
Tested solution is posted here :
https://community.st.com/0D50X00009nNBBHSA4
2017-12-23 02:50 PM
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
2018-06-21 09:37 AM
Tested solution is posted here :
https://community.st.com/0D50X00009nNBBHSA4