| 86 | } |
| 87 | |
| 88 | void hardfault_handler( uint32_t *faultStackedAddress ) |
| 89 | { |
| 90 | /* These are volatile to try and prevent the compiler/linker optimising them |
| 91 | * away as when debugging as the variables never actually get used. */ |
| 92 | volatile StackFrame_t stack __attribute__((unused)); |
| 93 | volatile CFSR_t _CFSR __attribute__((unused)); |
| 94 | volatile HFSR_t _HFSR __attribute__((unused)); |
| 95 | volatile DFSR_t _DFSR __attribute__((unused)); |
| 96 | volatile uint32_t _AFSR __attribute__((unused)); |
| 97 | volatile uint32_t _BFAR __attribute__((unused)); |
| 98 | volatile uint32_t _MMAR __attribute__((unused)); |
| 99 | |
| 100 | stack = *(StackFrame_t*) faultStackedAddress; // Previous stack frame |
| 101 | _CFSR = *CFSR; // Configurable Fault Status Register |
| 102 | _HFSR = *HFSR; // Hard Fault Status Register |
| 103 | _DFSR = *DFSR; // Debug Fault Status Register |
| 104 | _AFSR = SCB->AFSR; // Auxiliary Fault Status Register ( Vendor Specific ) |
| 105 | _MMAR = SCB->MMFAR; // MemManage Fault Address Register |
| 106 | _BFAR = SCB->BFAR; // Bus Fault Address Register |
| 107 | |
| 108 | /* gdb: |
| 109 | * set output-radix 16 |
| 110 | * info locals |
| 111 | * x/i _MMAR |
| 112 | * x/i _BFAR |
| 113 | * x/i stack.pc |
| 114 | */ |
| 115 | fault_isr(); |
| 116 | } |
| 117 | |
| 118 | void memfault_handler( uint32_t *faultStackedAddress ) { |
| 119 | volatile StackFrame_t frame = *(StackFrame_t*) faultStackedAddress; |
nothing calls this directly
no test coverage detected
searching dependent graphs…