Micro-Controller platform: STM32L0x1
Environment: Bare-Metal (No OS)
Brief description of the problem:
From interrupt context, we are trying to copy information received to EEPROM. Soon after entering into this routine, we it hard fault.
I started to debug according to the information provided here,
But still can't exactly figure out the reason. In fact just to verify, even if we don't write to EEPROM the program still crashed. I have attached register information here.
I suspect it could be something related to stack corruption but unable to prove my theory. Any direction to solve this mystery will be greatly appreciated.
Your PSP is not set!
Thank you Bastian Schick.
As per my understanding, I believe we are not using PSP in our application. Since our application is without OS and CONTROL register is always set to zero in our application.
Please see image below. This is were I obtained the above information (Definitive Guide to ARM Cortex M0/ M0+ book, Section - 11 (fault Handling) 11.3 (Analyze a Fault)). Please correct me if my understanding is wrong.
You set it to zero but it is -4?! I'd just try and set it to a RAM address.
42Bastian Schick : I didn't set PSP value (not sure how to do it either). PSP value was always set to -4 while I was debugging the code (step through instructions). I'm not sure how to modify the value of PSP.
View all questions in Cortex-M / M-Profile forum