cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Hardfault with my application

devendra
Associate II

Hello all I am facing a issue my program works however when is executes this part it runs only once after that it ran into hard fault. I have attached the snap of structure part of code which cause it and also exception observation please let me know if you do have any suggestion.

 

devendra_0-1730998040941.pngdevendra_1-1730998061085.jpegdevendra_2-1730998106266.pngdevendra_3-1730998124147.jpeg

 

3 REPLIES 3
Andrew Neil
Evangelist III

On debugging Hard Faults - both Cortex-M in general, and STM32 in particular:

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/tac-p/708193/highlight/true#M51

 

and please scroll to the top of that thread for how to properly post source code - not as images ...

SofLit
ST Employee

Hello,

Need to read this article on how to debug the hard fault.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Identify the processor

Show the registers

Show the code (disassembly) at the failure

Reading something from a bad pointer? Misaligned?

https://github.com/cturvey/RandomNinjaChef/blob/main/KeilHardFault.c

I perhaps need to migrate this to GNU/GCC variant, and g_pfnVectors

 

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