...
Faults print the current time (OS time), and the contents of various registers. The following code stores a value at an invalid memory location:
No Format |
---|
int *dummypointer; dummypointer = (int *) 0x20302030; // this is outside of SRAM *dummypointer = 42; |
Which results in the following fault:
No Format |
---|
Time = 59a04 Fault R0 = 2a R1 = 20302030 R2 = 200008d4 R3 = 4 R12 = 0 LR = 489c5 PC = 4ccce (Program counter - this may be able to tell you which part of the code is causing the fault) PSR = 21000000 BFAR = 20302030 (Bus Fault Address Register - may contain the bad address or the BFAR address of e000ed38) CFSR = 8200 (Configurable Fault Status Registers - indicates precise data bus error and BFAR holds address) HFSR = 0 (HardFault Status register) DFSR = 0 (Debug Fault Status Register) AFSR = 0 (Auxiliary Fault Status Register) MFAR = 20302030 (MemManage Address Register - may contain the bad address or the MFAR address of e000ed34) IPSR = 400805 NVIC_ACTIVE0_R = 0 NVIC_ACTIVE1_R = 0 NVIC_SYS_HND_CTRL_R = 70002 (System Handler Control and State Register) SP = 200008c8 |
...
Changing pointer
to a null pointer results in an MPU fault:
No Format |
---|
MPU Fault
Time = 3eb2
LR = 489c5
PC = 4ccce
BFAR = 0 |
See the Cortex-M3 Technical Reference Manual for more details.
...