Skip to main content
Associate
September 18, 2024
Solved

Hardfault error at timer callback

  • September 18, 2024
  • 2 replies
  • 1519 views

The thing is,i have a custom design board with STM32F446RE  and it's Nucleo variant
i have a code with multiple timers but when i run the program on my custom board it goes to Hardfault error after a timer callback but the same problem dosent happens with the Nucleo board although the code remains the same

Best answer by Tesla DeLorean

Don't discount bad design

Make sure clock expectations are the same, make sure VCAP capacitors are correctly rated as designed/populated. You've got 4u7 F between them, and see 1.25V

Check FLASH wait states.

Root Cause the HARD FAULT, with a handler that does a better job than while(1) silently dying.

2 replies

mƎALLEm
Technical Moderator
September 18, 2024

Hello @Nirbhik and welcome to the community.


@Nirbhik wrote:

The thing is,i have a custom design board with STM32F446RE  and it's Nucleo variant.


What do you mean by variant. is it Blue/Black pill board?

Do you have the same Clock source and frequency values?

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
NirbhikAuthor
Associate
September 19, 2024

i have the NUCLEO-F446RE and yes i have the same clock source as i am using the same clock based on the internal oscillator

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
September 18, 2024

Don't discount bad design

Make sure clock expectations are the same, make sure VCAP capacitors are correctly rated as designed/populated. You've got 4u7 F between them, and see 1.25V

Check FLASH wait states.

Root Cause the HARD FAULT, with a handler that does a better job than while(1) silently dying.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
NirbhikAuthor
Associate
September 19, 2024

Yes i hadn't placed a capacitor at the Vcap pin 
also about your last statement
"Root Cause the HARD FAULT, with a handler that does a better job than while(1) silently dying."
i use the debug tools of ST and i was able to pinpoint the error because of the call stack whose image i am attaching below