|
STM32 RTOS 0.2.3
Bare-metal preemptive RTOS for STM32F446RE
|
Fault driver: enable the configurable faults and record a fault for the debugger. More...
Go to the source code of this file.
Data Structures | |
| struct | FaultRecord_t |
| What Fault_Handler saw. More... | |
Typedefs | |
| typedef struct FaultRecord_t | FaultRecord_t |
| What Fault_Handler saw. | |
Functions | |
| void | faultEnable (ScbRegisters_t *scb) |
| Give MemManage, BusFault and UsageFault their own handlers, and trap integer division by zero. | |
| void | faultCapture (FaultRecord_t *record, const ScbRegisters_t *scb, const uint32_t *frame, uint32_t exc_return) |
Fill record from the fault status registers and the stacked frame. | |
Variables | |
| FaultRecord_t | faultRecord |
| Filled by Fault_Handler; read it from the debugger. | |
Fault driver: enable the configurable faults and record a fault for the debugger.
HardFault, MemManage, BusFault and UsageFault all enter Fault_Handler in the startup file. It passes the stacked frame to faultCapture(), which fills faultRecord, then spins. Nothing is returned to: a fault is fatal until the kernel has a policy for it. Halt the core and read the record:
Without faultEnable(), MemManage, BusFault and UsageFault escalate to HardFault (HFSR.FORCED). CFSR still names the cause, so the record is just as useful; only the exception number differs.
Definition in file fault.h.