cancel
Showing results for 
Search instead for 
Did you mean: 

How to know what cause Error_Handler?

Jiannong Zhou
Associate II

Often trip to Error_Handler from usb_device.c and usbd_conf.c.

void Error_Handler(void)

{

 /* USER CODE BEGIN Error_Handler_Debug */

 /* User can add his own implementation to report the HAL error return state */

 __disable_irq();

 while (1)

 {

 }

 /* USER CODE END Error_Handler_Debug */

}

How can I know how cause this issue?

Thanks,

Jiannong

4 REPLIES 4

>>How can I know how cause this issue?

Go back up the call stack?

Instrument the places it is called from so you understand the issues that it encountered?

Perhaps use the version that's passed the source file, and line number, so you can quickly identify and report where it came from?

Error_Handler(__FILE__, __LINE__); // ??

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Piranha
Chief II
 /* User can add his own implementation to report the HAL error return state */

And where the user is supposed to get the HAL error in this function? I guess it's a rhetorical question...

Jiannong Zhou
Associate II

Hi Tesla and Piranha,

I got your ideals. thank you very much for your suggestion.

Jiannong

Certainly a "Roll Over and Die" approach from ST

This could have been executed so much better, that and having the Hard Fault Handler do something remotely useful. Instead we have thousands of users, wasting thousands of man-hours, and learning so little...

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