Cortex-M3 uses a completely different model for handling exceptions from the "classic" ARM, for example. it does not have the โinterrupt modeโ mentioned in another message. I suggest you read this application note . For example, for a hard failure:
The value SCB-> BFAR indicates the memory address that caused the bus error and is valid if the BFARVALID bit in the SCB-> CFSR register is set. the value SCB-> MMFAR indicates the memory address that caused the memory. The control error is valid if the MMFARVALID bit in the SCB-> CFSR register is set.
To determine the value of the PC at the time of the exception, you need to examine the stack; the processor starts R0-R3, R12, PC, and LR before executing the handler. The stack used can be either the main one (if bit 2 LR is 0), or a process (otherwise). For details, see Page 13 notes to the application.
source share