STM32 RTOS 0.2.3
Bare-metal preemptive RTOS for STM32F446RE
Loading...
Searching...
No Matches
fault.h
Go to the documentation of this file.
1
20#ifndef FAULT_H
21#define FAULT_H
22
23#include "scb_reg.h"
24
25#include <stdbool.h>
26#include <stdint.h>
27
32
34typedef struct FaultRecord_t
35{
36 uint32_t exception;
37 uint32_t exc_return;
38 uint32_t cfsr;
39 uint32_t hfsr;
40 uint32_t mmfar;
41 uint32_t bfar;
46 uint32_t r0;
47 uint32_t r1;
48 uint32_t r2;
49 uint32_t r3;
50 uint32_t r12;
51 uint32_t lr;
52 uint32_t pc;
53 uint32_t xpsr;
55
58
70
84void faultCapture(FaultRecord_t *record, const ScbRegisters_t *scb, const uint32_t *frame,
85 uint32_t exc_return);
86
88
89#endif /* FAULT_H */
void faultEnable(ScbRegisters_t *scb)
Give MemManage, BusFault and UsageFault their own handlers, and trap integer division by zero.
Definition fault.c:14
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.
Definition fault.c:20
FaultRecord_t faultRecord
Filled by Fault_Handler; read it from the debugger.
Definition fault.c:12
SCB and FPU context-control registers (PM0214, SCB and FPU chapters).
What Fault_Handler saw.
Definition fault.h:35
uint32_t bfar
BFAR; the fault address only if CFSR.BFARVALID.
Definition fault.h:41
uint32_t exception
ICSR.VECTACTIVE: 3 HardFault, 4 MemManage, 5 BusFault, 6 UsageFault.
Definition fault.h:36
uint32_t lr
Stacked LR: the faulting function's return address.
Definition fault.h:51
uint32_t r1
Stacked R1.
Definition fault.h:47
bool frame_valid
The registers below were read from the stacked frame.
Definition fault.h:45
uint32_t pc
Stacked PC: the faulting instruction, or the next one for an imprecise fault.
Definition fault.h:52
uint32_t mmfar
MMFAR; the fault address only if CFSR.MMARVALID.
Definition fault.h:40
uint32_t xpsr
Stacked xPSR.
Definition fault.h:53
uint32_t exc_return
LR on entry; bit 2 set means the frame is on PSP.
Definition fault.h:37
uint32_t cfsr
CFSR: MMFSR (7:0), BFSR (15:8), UFSR (31:16).
Definition fault.h:38
uint32_t r0
Stacked R0.
Definition fault.h:46
uint32_t r2
Stacked R2.
Definition fault.h:48
uint32_t r3
Stacked R3.
Definition fault.h:49
uint32_t r12
Stacked R12.
Definition fault.h:50
uint32_t hfsr
HFSR: FORCED means a configurable fault escalated.
Definition fault.h:39
SCB register block.
Definition scb_reg.h:41