cancel
Showing results for 
Search instead for 
Did you mean: 

On my STM32F103C8 my code execution jumps intoto Error_Handler() function but I cannot find who generates the error?

CSand
Associate III

I have a simple code I'm using I2C and TIM2 timer interrupt at 100us.

Initially I suspected the issue comes from HAL_TIM_PeriodElapsedCallback but the code inside this function is really few instructions.

In the main.c there are two calls of Error_Handler, both in SystemClock_Config but I checked and the issues is not comming from there.

Could you please support and advice how can I indentify where is the call of the Error_Handler?

If required I can share the code.

Thanks

3 REPLIES 3
TDK
Guru

Set a breakpoint in Error_Handler. The stack trace will show where it came from.

If you feel a post has answered your question, please click "Accept as Solution".

Check the return address (LR) to see where it came from.

This is the other reason to use the Error_Handler(__FILE__, __LINE__); form, lot easier to run to ground, and get an end user to report via email/phone.

Have the HardFault_Handler() output actionable data also.

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

Thanks for helping.

Anyway, I am not sure why this error handler does not have an error id. It just seems strange.