Hardfault Exception Debugging
The Hardfault Exception sometimes occurs during system operation.
The register and stack values are as follows after the hardfault exception occurrence.
The MSP 0x20003780 points to the stack area storing the register information(LR, PC etc) at the moment of the hardfault .
According to the above stack informations, the LR is 0x080085CD and PC is 0x04020000.
The Address 0x04020000 is not code area. ==> Hardfault Exception Occurrence.
The code of the LR 0x080085CD is as follows.
Did the hardfault occur as the instruction "POP {r4-r5, pc}" is executed?
The stack area of the above SP 0x2000377C is as follows.
I guess that the 'pc' value of the POP instruction would be overwritted to '0x04020000'.
How can I solve this problem?(Why does the hardfault occur?)
Is it possible to set the breakpoint when the memory 0x20003784 is written to the value '0x04020000'?
