Hi everyone, There was a post of this question here: Returning from MemFault - Architectures and Processors forum - Support forums - Arm CommunityBut I don't see any reply on this post and it has been locked
I cannot find any document or guideline about how to return from MemManageFault exception on Cortex-M4
I am using the stm32f4 (cortex m4), trying to set up a read-only region, enable MemManageFault and MPU, write to the read-only region
The MemManageFault is triggered: + MMFAR register update to the accessed address + CFSR.MemManage (MMFSR) = 0x82
Everything is good but then I cannot return from the MemManageFault, the CPU constantly gets back to the write instruction which caused the error and the MemManageFault exception handler.
As the ARMv7-M Architecture RM states: write a one to a register bit to clear the corresponding fault.
I try to return from MemManageFault by clearing the error (write 0x84 to CFSR.MemManage (MMFSR) and clear the error address MMFAR. but it seems like the two registers are not cleared. then the exception re-trigger again and again.In addition, I know we can back up the error information somewhere (for example non-volatile memory), then trigger a system reset. after system reset, the error is cleared.
My question is how to clear the MemManage error, and return from the exception to continue other instructions after the fault without reset the system.I am really appreciate any reply. Thanks