System Control Block (SCB) Register Descriptions
1680
SPRUHE8E – October 2012 – Revised November 2019
Copyright © 2012–2019, Texas Instruments Incorporated
Cortex-M3 Peripherals
25.6.12 Configurable Fault Status (FAULTSTAT) Register, offset 0xD28
Note:
This register can only be accessed from privileged mode.
The Configurable Fault Status (FAULTSTAT) register indicates the cause of a memory management fault,
bus fault, or usage fault. Each of these functions is assigned to a subregister as follows:
•
Usage Fault Status (UFAULTSTAT), bits 31:16
•
Bus Fault Status (BFAULTSTAT), bits 15:8
•
Memory Management Fault Status (MFAULTSTAT), bits 7:0
FAULTSTAT is byte accessible. FAULTSTAT or its subregisters can be accessed as follows:
•
The complete FAULTSTAT register, with a word access to offset 0xD28
•
The MFAULTSTAT, with a byte access to offset 0xD28
•
The MFAULTSTAT and BFAULTSTAT, with a halfword access to offset 0xD28
•
The BFAULTSTAT, with a byte access to offset 0xD29
•
The UFAULTSTAT, with a halfword access to offset 0xD2A
Bits are cleared by writing a 1 to them.
In a fault handler, the true faulting address can be determined by:
•
Read and save the Memory Management Fault Address (MMADDR) or Bus Fault Address
(FAULTADDR) value.
•
Read the MMARV bit in MFAULTSTAT, or the BFARV bit in BFAULTSTAT to determine if the
MMADDR or FAULTADDR contents are valid.
Software must follow this sequence because another higher priority exception might change the MMADDR
or FAULTADDR value. For example, if a higher priority handler preempts the current fault handler, the
other fault might change the MMADDR or FAULTADDR value.
Figure 25-43. Configurable Fault Status (FAULTSTAT) Register
31
30
29
28
27
26
25
24
Reserved
DIV0
UNALIGN
R-0
R/W-1C-0
R/W-1C-0
23
22
21
20
19
18
17
16
Reserved
NOCP
INVPC
INVSTAT
UNDEF
R-0
R/W-1C-0
R/W-1C-0
R/W-1C-0
R/W-1C-0
15
14
13
12
11
10
9
8
BFARV
Reserved
BSTKE
BUSTKE
IMPRE
PRECISE
IBUS
R/W-1C-0
R-0
R/W-1C-0
R/W-1C-0
R/W-1C-0
R/W-1C-0
R/W-1C-0
7
6
5
4
3
2
1
0
MMARV
Reserved
MSTKE
MUSTKE
Reserved
DERR
IERR
R/W-1C-0
R-0
R/W-1C-0
R/W-1C-0
R-0
R/W-1C-0
R/W-1C-0
LEGEND: R/W = Read/Write; R = Read only; -
n
= value after reset
Table 25-50. Configurable Fault Status (FAULTSTAT) Register Field Descriptions
Bit
Field
Value
Description
31-26
Reserved
Reserved
25
DIV0
Divide-by-Zero Usage Fault
0
No divide-by-zero fault has occurred, or divide-by-zero trapping is not enabled.
1
The processor has executed an SDIV or UDIV instruction with a divisor of 0.
When this bit is set, the PC value stacked for the exception return points to the instruction that
performed the divide by zero. Trapping on divide-by-zero is enabled by setting the DIV0 bit in the
Configuration and Control (CFGCTRL) register).
This bit is cleared by writing a 1 to it.