cancel
Showing results for 
Search instead for 
Did you mean: 

printf not working via ITM_Sendchar, _write never called

hegde_08
Associate II

I am trying to use SWD for printing using ITM_Sendchar, Printf not calling _write, I tried to put breakpoint and see, But it is not hitting breakpoint

 

 

hegde_08_0-1765201262291.pnghegde_08_1-1765201284864.pnghegde_08_2-1765201298919.pnghegde_08_3-1765201309930.png

hegde_08_0-1765201502832.pnghegde_08_1-1765201558665.png

 

24 REPLIES 24

Clock speed needs to match.

Doesn't the STM32F3 have a default HSI of 8 MHz?

Use that speed.

Perhaps also output to the VCP USART so you can see in a Terminal app, and print out SystemCoreClock to confirm.

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

Plumbing on the HW and SW side seem OK.

Would check the clocking, because that needs to mesh. MCU starts off an internal clock, you'd need to enable external ones or setup PLL for that to be working.

The UART initialization unpacks the clocking, buses and sources to get baud rate there.

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

That's totally ok, Thank you

I was trying not to use HAL Drivers, But surely I will try this once

I just tried with 8Mhz, It worked, it was the clock mismatch. Thank you