STM32 RTOS 0.2.3
Bare-metal preemptive RTOS for STM32F446RE
Loading...
Searching...
No Matches

System Control Block. More...

Collaboration diagram for SCB:

Data Structures

struct  ScbRegisters_t
 SCB register block. More...

Macros

#define SCB_BASE   (0xE000ED00UL)
 SCB base address (System Control Space).
#define SCB   ((ScbRegisters_t *)SCB_BASE)
 The SCB instance.

Typedefs

typedef struct ScbRegisters_t ScbRegisters_t
 SCB register block.

AIRCR - application interrupt and reset control (0x0C)

Every write must carry SCB_AIRCR_VECTKEY_WRITE or it is ignored.

#define SCB_AIRCR_VECTRESET_Pos   (0U)
 Bit 0.
#define SCB_AIRCR_VECTRESET   ((uint32_t)1U << SCB_AIRCR_VECTRESET_Pos)
  wo Local reset; for debug use only.
#define SCB_AIRCR_SYSRESETREQ_Pos   (2U)
 Bit 2.
#define SCB_AIRCR_SYSRESETREQ   ((uint32_t)1U << SCB_AIRCR_SYSRESETREQ_Pos)
  wo Request a system reset.
#define SCB_AIRCR_PRIGROUP_Pos   (8U)
 Bits 10:8.
#define SCB_AIRCR_PRIGROUP_Msk   ((uint32_t)0x7U << SCB_AIRCR_PRIGROUP_Pos)
  rw Priority grouping; Reset_Handler sets 3 (all 4 bits preempt).
#define SCB_AIRCR_VECTKEY_Pos   (16U)
 Bits 31:16.
#define SCB_AIRCR_VECTKEY_Msk   ((uint32_t)0xFFFFU << SCB_AIRCR_VECTKEY_Pos)
  rw Write key; reads back 0xFA05.
#define SCB_AIRCR_VECTKEY_WRITE   ((uint32_t)0x5FAU << SCB_AIRCR_VECTKEY_Pos)
 Key value that makes an AIRCR write take effect.

ICSR - interrupt control and state (0x04)

#define SCB_ICSR_VECTACTIVE_Pos   (0U)
 Bits 8:0.
#define SCB_ICSR_VECTACTIVE_Msk   ((uint32_t)0x1FFU << SCB_ICSR_VECTACTIVE_Pos)
  ro Number of the active exception (0 in Thread mode).
#define SCB_ICSR_PENDSTCLR_Pos   (25U)
 Bit 25.
#define SCB_ICSR_PENDSTCLR   ((uint32_t)1U << SCB_ICSR_PENDSTCLR_Pos)
  wo Clear a pending SysTick.
#define SCB_ICSR_PENDSTSET_Pos   (26U)
 Bit 26.
#define SCB_ICSR_PENDSTSET   ((uint32_t)1U << SCB_ICSR_PENDSTSET_Pos)
  rw Pend SysTick; reads 1 while pending.
#define SCB_ICSR_PENDSVCLR_Pos   (27U)
 Bit 27.
#define SCB_ICSR_PENDSVCLR   ((uint32_t)1U << SCB_ICSR_PENDSVCLR_Pos)
  wo Clear a pending PendSV.
#define SCB_ICSR_PENDSVSET_Pos   (28U)
 Bit 28.
#define SCB_ICSR_PENDSVSET   ((uint32_t)1U << SCB_ICSR_PENDSVSET_Pos)
  rw Pend PendSV (requests a context switch); reads 1 while pending.

SCR - system control (0x10)

Every bit is rw.

#define SCB_SCR_SLEEPONEXIT_Pos   (1U)
 Bit 1.
#define SCB_SCR_SLEEPONEXIT   ((uint32_t)1U << SCB_SCR_SLEEPONEXIT_Pos)
 Sleep on return from an exception to Thread mode.
#define SCB_SCR_SLEEPDEEP_Pos   (2U)
 Bit 2.
#define SCB_SCR_SLEEPDEEP   ((uint32_t)1U << SCB_SCR_SLEEPDEEP_Pos)
 WFI/WFE enters deep sleep.
#define SCB_SCR_SEVONPEND_Pos   (4U)
 Bit 4.
#define SCB_SCR_SEVONPEND   ((uint32_t)1U << SCB_SCR_SEVONPEND_Pos)
 A pended interrupt wakes WFE.

CCR - configuration and control (0x14)

Every bit is rw.

#define SCB_CCR_NONBASETHRDENA_Pos   (0U)
 Bit 0.
#define SCB_CCR_NONBASETHRDENA   ((uint32_t)1U << SCB_CCR_NONBASETHRDENA_Pos)
 Allow Thread mode entry from any exception level.
#define SCB_CCR_USERSETMPEND_Pos   (1U)
 Bit 1.
#define SCB_CCR_USERSETMPEND   ((uint32_t)1U << SCB_CCR_USERSETMPEND_Pos)
 Allow unprivileged code to write STIR.
#define SCB_CCR_UNALIGN_TRP_Pos   (3U)
 Bit 3.
#define SCB_CCR_UNALIGN_TRP   ((uint32_t)1U << SCB_CCR_UNALIGN_TRP_Pos)
 Trap unaligned accesses.
#define SCB_CCR_DIV_0_TRP_Pos   (4U)
 Bit 4.
#define SCB_CCR_DIV_0_TRP   ((uint32_t)1U << SCB_CCR_DIV_0_TRP_Pos)
 Trap divide by zero.
#define SCB_CCR_BFHFNMIGN_Pos   (8U)
 Bit 8.
#define SCB_CCR_BFHFNMIGN   ((uint32_t)1U << SCB_CCR_BFHFNMIGN_Pos)
 Ignore data bus faults in HardFault, NMI and FAULTMASK handlers.
#define SCB_CCR_STKALIGN_Pos   (9U)
 Bit 9.
#define SCB_CCR_STKALIGN   ((uint32_t)1U << SCB_CCR_STKALIGN_Pos)
 Align the stack to 8 bytes on exception entry.

SHCSR - system handler control and state (0x24)

Every bit is rw: ACT = active, PENDED = pending, ENA = enabled.

#define SCB_SHCSR_MEMFAULTACT_Pos   (0U)
 Bit 0.
#define SCB_SHCSR_MEMFAULTACT   ((uint32_t)1U << SCB_SHCSR_MEMFAULTACT_Pos)
 MemManage active.
#define SCB_SHCSR_BUSFAULTACT_Pos   (1U)
 Bit 1.
#define SCB_SHCSR_BUSFAULTACT   ((uint32_t)1U << SCB_SHCSR_BUSFAULTACT_Pos)
 BusFault active.
#define SCB_SHCSR_USGFAULTACT_Pos   (3U)
 Bit 3.
#define SCB_SHCSR_USGFAULTACT   ((uint32_t)1U << SCB_SHCSR_USGFAULTACT_Pos)
 UsageFault active.
#define SCB_SHCSR_SVCALLACT_Pos   (7U)
 Bit 7.
#define SCB_SHCSR_SVCALLACT   ((uint32_t)1U << SCB_SHCSR_SVCALLACT_Pos)
 SVCall active.
#define SCB_SHCSR_PENDSVACT_Pos   (10U)
 Bit 10.
#define SCB_SHCSR_PENDSVACT   ((uint32_t)1U << SCB_SHCSR_PENDSVACT_Pos)
 PendSV active.
#define SCB_SHCSR_SYSTICKACT_Pos   (11U)
 Bit 11.
#define SCB_SHCSR_SYSTICKACT   ((uint32_t)1U << SCB_SHCSR_SYSTICKACT_Pos)
 SysTick active.
#define SCB_SHCSR_USGFAULTPENDED_Pos   (12U)
 Bit 12.
#define SCB_SHCSR_USGFAULTPENDED   ((uint32_t)1U << SCB_SHCSR_USGFAULTPENDED_Pos)
 UsageFault pending.
#define SCB_SHCSR_MEMFAULTPENDED_Pos   (13U)
 Bit 13.
#define SCB_SHCSR_MEMFAULTPENDED   ((uint32_t)1U << SCB_SHCSR_MEMFAULTPENDED_Pos)
 MemManage pending.
#define SCB_SHCSR_BUSFAULTPENDED_Pos   (14U)
 Bit 14.
#define SCB_SHCSR_BUSFAULTPENDED   ((uint32_t)1U << SCB_SHCSR_BUSFAULTPENDED_Pos)
 BusFault pending.
#define SCB_SHCSR_SVCALLPENDED_Pos   (15U)
 Bit 15.
#define SCB_SHCSR_SVCALLPENDED   ((uint32_t)1U << SCB_SHCSR_SVCALLPENDED_Pos)
 SVCall pending.
#define SCB_SHCSR_MEMFAULTENA_Pos   (16U)
 Bit 16.
#define SCB_SHCSR_MEMFAULTENA   ((uint32_t)1U << SCB_SHCSR_MEMFAULTENA_Pos)
 Enable MemManage (otherwise it escalates to HardFault).
#define SCB_SHCSR_BUSFAULTENA_Pos   (17U)
 Bit 17.
#define SCB_SHCSR_BUSFAULTENA   ((uint32_t)1U << SCB_SHCSR_BUSFAULTENA_Pos)
 Enable BusFault (otherwise it escalates to HardFault).
#define SCB_SHCSR_USGFAULTENA_Pos   (18U)
 Bit 18.
#define SCB_SHCSR_USGFAULTENA   ((uint32_t)1U << SCB_SHCSR_USGFAULTENA_Pos)
 Enable UsageFault (otherwise it escalates to HardFault).

CFSR - configurable fault status (0x28)

Bits 7:0 are MMFSR, 15:8 BFSR, 31:16 UFSR.

Every bit is rc_w1.

#define SCB_CFSR_IACCVIOL_Pos   (0U)
 Bit 0.
#define SCB_CFSR_IACCVIOL   ((uint32_t)1U << SCB_CFSR_IACCVIOL_Pos)
 MemManage: instruction access violation.
#define SCB_CFSR_DACCVIOL_Pos   (1U)
 Bit 1.
#define SCB_CFSR_DACCVIOL   ((uint32_t)1U << SCB_CFSR_DACCVIOL_Pos)
 MemManage: data access violation; MMFAR holds the address if MMARVALID.
#define SCB_CFSR_MUNSTKERR_Pos   (3U)
 Bit 3.
#define SCB_CFSR_MUNSTKERR   ((uint32_t)1U << SCB_CFSR_MUNSTKERR_Pos)
 MemManage: fault while unstacking on exception return.
#define SCB_CFSR_MSTKERR_Pos   (4U)
 Bit 4.
#define SCB_CFSR_MSTKERR   ((uint32_t)1U << SCB_CFSR_MSTKERR_Pos)
 MemManage: fault while stacking on exception entry.
#define SCB_CFSR_MLSPERR_Pos   (5U)
 Bit 5.
#define SCB_CFSR_MLSPERR   ((uint32_t)1U << SCB_CFSR_MLSPERR_Pos)
 MemManage: fault during lazy FP state preservation.
#define SCB_CFSR_MMARVALID_Pos   (7U)
 Bit 7.
#define SCB_CFSR_MMARVALID   ((uint32_t)1U << SCB_CFSR_MMARVALID_Pos)
 MMFAR holds a valid fault address.
#define SCB_CFSR_IBUSERR_Pos   (8U)
 Bit 8.
#define SCB_CFSR_IBUSERR   ((uint32_t)1U << SCB_CFSR_IBUSERR_Pos)
 BusFault: instruction fetch.
#define SCB_CFSR_PRECISERR_Pos   (9U)
 Bit 9.
#define SCB_CFSR_PRECISERR   ((uint32_t)1U << SCB_CFSR_PRECISERR_Pos)
 BusFault: precise data access; BFAR holds the address if BFARVALID.
#define SCB_CFSR_IMPRECISERR_Pos   (10U)
 Bit 10.
#define SCB_CFSR_IMPRECISERR   ((uint32_t)1U << SCB_CFSR_IMPRECISERR_Pos)
 BusFault: imprecise data access (no address).
#define SCB_CFSR_UNSTKERR_Pos   (11U)
 Bit 11.
#define SCB_CFSR_UNSTKERR   ((uint32_t)1U << SCB_CFSR_UNSTKERR_Pos)
 BusFault: fault while unstacking on exception return.
#define SCB_CFSR_STKERR_Pos   (12U)
 Bit 12.
#define SCB_CFSR_STKERR   ((uint32_t)1U << SCB_CFSR_STKERR_Pos)
 BusFault: fault while stacking on exception entry.
#define SCB_CFSR_LSPERR_Pos   (13U)
 Bit 13.
#define SCB_CFSR_LSPERR   ((uint32_t)1U << SCB_CFSR_LSPERR_Pos)
 BusFault: fault during lazy FP state preservation.
#define SCB_CFSR_BFARVALID_Pos   (15U)
 Bit 15.
#define SCB_CFSR_BFARVALID   ((uint32_t)1U << SCB_CFSR_BFARVALID_Pos)
 BFAR holds a valid fault address.
#define SCB_CFSR_UNDEFINSTR_Pos   (16U)
 Bit 16.
#define SCB_CFSR_UNDEFINSTR   ((uint32_t)1U << SCB_CFSR_UNDEFINSTR_Pos)
 UsageFault: undefined instruction.
#define SCB_CFSR_INVSTATE_Pos   (17U)
 Bit 17.
#define SCB_CFSR_INVSTATE   ((uint32_t)1U << SCB_CFSR_INVSTATE_Pos)
 UsageFault: invalid EPSR state (for example a Thumb bit of 0).
#define SCB_CFSR_INVPC_Pos   (18U)
 Bit 18.
#define SCB_CFSR_INVPC   ((uint32_t)1U << SCB_CFSR_INVPC_Pos)
 UsageFault: invalid PC load or EXC_RETURN.
#define SCB_CFSR_NOCP_Pos   (19U)
 Bit 19.
#define SCB_CFSR_NOCP   ((uint32_t)1U << SCB_CFSR_NOCP_Pos)
 UsageFault: coprocessor (FPU) access while disabled in CPACR.
#define SCB_CFSR_UNALIGNED_Pos   (24U)
 Bit 24.
#define SCB_CFSR_UNALIGNED   ((uint32_t)1U << SCB_CFSR_UNALIGNED_Pos)
 UsageFault: unaligned access with CCR.UNALIGN_TRP set.
#define SCB_CFSR_DIVBYZERO_Pos   (25U)
 Bit 25.
#define SCB_CFSR_DIVBYZERO   ((uint32_t)1U << SCB_CFSR_DIVBYZERO_Pos)
 UsageFault: divide by zero with CCR.DIV_0_TRP set.

HFSR - HardFault status (0x2C)

Every bit is rc_w1.

#define SCB_HFSR_VECTTBL_Pos   (1U)
 Bit 1.
#define SCB_HFSR_VECTTBL   ((uint32_t)1U << SCB_HFSR_VECTTBL_Pos)
 Bus fault while reading the vector table.
#define SCB_HFSR_FORCED_Pos   (30U)
 Bit 30.
#define SCB_HFSR_FORCED   ((uint32_t)1U << SCB_HFSR_FORCED_Pos)
 A configurable fault escalated to HardFault; see CFSR.
#define SCB_HFSR_DEBUGEVT_Pos   (31U)
 Bit 31.
#define SCB_HFSR_DEBUGEVT   ((uint32_t)1U << SCB_HFSR_DEBUGEVT_Pos)
 Debug event.

SHPR1-3 - system handler priorities (0x18-0x20)

One rw byte per handler; only the top 4 bits are implemented.

#define SCB_SHPR1_PRI_4_Pos   (0U)
 Bits 7:0.
#define SCB_SHPR1_PRI_4_Msk   ((uint32_t)0xFFU << SCB_SHPR1_PRI_4_Pos)
 MemManage priority.
#define SCB_SHPR1_PRI_5_Pos   (8U)
 Bits 15:8.
#define SCB_SHPR1_PRI_5_Msk   ((uint32_t)0xFFU << SCB_SHPR1_PRI_5_Pos)
 BusFault priority.
#define SCB_SHPR1_PRI_6_Pos   (16U)
 Bits 23:16.
#define SCB_SHPR1_PRI_6_Msk   ((uint32_t)0xFFU << SCB_SHPR1_PRI_6_Pos)
 UsageFault priority.
#define SCB_SHPR2_PRI_11_Pos   (24U)
 Bits 31:24.
#define SCB_SHPR2_PRI_11_Msk   ((uint32_t)0xFFU << SCB_SHPR2_PRI_11_Pos)
 SVCall priority.
#define SCB_SHPR3_PRI_14_Pos   (16U)
 Bits 23:16.
#define SCB_SHPR3_PRI_14_Msk   ((uint32_t)0xFFU << SCB_SHPR3_PRI_14_Pos)
 PendSV priority.
#define SCB_SHPR3_PRI_15_Pos   (24U)
 Bits 31:24.
#define SCB_SHPR3_PRI_15_Msk   ((uint32_t)0xFFU << SCB_SHPR3_PRI_15_Pos)
 SysTick priority.

CPACR - coprocessor access control (0x88)

#define SCB_CPACR_CP10_Pos   (20U)
 Bits 21:20.
#define SCB_CPACR_CP10_Msk   ((uint32_t)0x3U << SCB_CPACR_CP10_Pos)
  rw FPU access (CP10); 0b11 = full.
#define SCB_CPACR_CP11_Pos   (22U)
 Bits 23:22.
#define SCB_CPACR_CP11_Msk   ((uint32_t)0x3U << SCB_CPACR_CP11_Pos)
  rw FPU access (CP11); must match CP10.

EXC_RETURN values

The LR value on exception entry; branching to it returns (PM0214 Table 2-17).

The _FPU variants pop an extended frame with FPU state.

#define EXC_RETURN_HANDLER   (0xFFFFFFF1UL)
 Handler mode, MSP, basic frame.
#define EXC_RETURN_THREAD_MSP   (0xFFFFFFF9UL)
 Thread mode, MSP, basic frame.
#define EXC_RETURN_THREAD_PSP   (0xFFFFFFFDUL)
 Thread mode, PSP, basic frame.
#define EXC_RETURN_HANDLER_FPU   (0xFFFFFFE1UL)
 Handler mode, MSP, extended frame.
#define EXC_RETURN_THREAD_MSP_FPU   (0xFFFFFFE9UL)
 Thread mode, MSP, extended frame.
#define EXC_RETURN_THREAD_PSP_FPU   (0xFFFFFFEDUL)
 Thread mode, PSP, extended frame.

Detailed Description

System Control Block.

Macro Definition Documentation

◆ SCB_BASE

#define SCB_BASE   (0xE000ED00UL)

SCB base address (System Control Space).

Definition at line 21 of file scb_reg.h.

◆ SCB

#define SCB   ((ScbRegisters_t *)SCB_BASE)

The SCB instance.

Definition at line 62 of file scb_reg.h.

◆ SCB_AIRCR_VECTRESET_Pos

#define SCB_AIRCR_VECTRESET_Pos   (0U)

Bit 0.

Definition at line 91 of file scb_reg.h.

◆ SCB_AIRCR_VECTRESET

#define SCB_AIRCR_VECTRESET   ((uint32_t)1U << SCB_AIRCR_VECTRESET_Pos)

wo Local reset; for debug use only.

Definition at line 93 of file scb_reg.h.

◆ SCB_AIRCR_SYSRESETREQ_Pos

#define SCB_AIRCR_SYSRESETREQ_Pos   (2U)

Bit 2.

Definition at line 94 of file scb_reg.h.

◆ SCB_AIRCR_SYSRESETREQ

#define SCB_AIRCR_SYSRESETREQ   ((uint32_t)1U << SCB_AIRCR_SYSRESETREQ_Pos)

wo Request a system reset.

Definition at line 96 of file scb_reg.h.

◆ SCB_AIRCR_PRIGROUP_Pos

#define SCB_AIRCR_PRIGROUP_Pos   (8U)

Bits 10:8.

Definition at line 97 of file scb_reg.h.

◆ SCB_AIRCR_PRIGROUP_Msk

#define SCB_AIRCR_PRIGROUP_Msk   ((uint32_t)0x7U << SCB_AIRCR_PRIGROUP_Pos)

rw Priority grouping; Reset_Handler sets 3 (all 4 bits preempt).

Definition at line 99 of file scb_reg.h.

◆ SCB_AIRCR_VECTKEY_Pos

#define SCB_AIRCR_VECTKEY_Pos   (16U)

Bits 31:16.

Definition at line 100 of file scb_reg.h.

◆ SCB_AIRCR_VECTKEY_Msk

#define SCB_AIRCR_VECTKEY_Msk   ((uint32_t)0xFFFFU << SCB_AIRCR_VECTKEY_Pos)

rw Write key; reads back 0xFA05.

Definition at line 102 of file scb_reg.h.

◆ SCB_AIRCR_VECTKEY_WRITE

#define SCB_AIRCR_VECTKEY_WRITE   ((uint32_t)0x5FAU << SCB_AIRCR_VECTKEY_Pos)

Key value that makes an AIRCR write take effect.

Definition at line 104 of file scb_reg.h.

◆ SCB_ICSR_VECTACTIVE_Pos

#define SCB_ICSR_VECTACTIVE_Pos   (0U)

Bits 8:0.

Definition at line 109 of file scb_reg.h.

Referenced by faultCapture().

◆ SCB_ICSR_VECTACTIVE_Msk

#define SCB_ICSR_VECTACTIVE_Msk   ((uint32_t)0x1FFU << SCB_ICSR_VECTACTIVE_Pos)

ro Number of the active exception (0 in Thread mode).

Definition at line 111 of file scb_reg.h.

Referenced by faultCapture().

◆ SCB_ICSR_PENDSTCLR_Pos

#define SCB_ICSR_PENDSTCLR_Pos   (25U)

Bit 25.

Definition at line 112 of file scb_reg.h.

◆ SCB_ICSR_PENDSTCLR

#define SCB_ICSR_PENDSTCLR   ((uint32_t)1U << SCB_ICSR_PENDSTCLR_Pos)

wo Clear a pending SysTick.

Definition at line 114 of file scb_reg.h.

◆ SCB_ICSR_PENDSTSET_Pos

#define SCB_ICSR_PENDSTSET_Pos   (26U)

Bit 26.

Definition at line 115 of file scb_reg.h.

◆ SCB_ICSR_PENDSTSET

#define SCB_ICSR_PENDSTSET   ((uint32_t)1U << SCB_ICSR_PENDSTSET_Pos)

rw Pend SysTick; reads 1 while pending.

Definition at line 117 of file scb_reg.h.

◆ SCB_ICSR_PENDSVCLR_Pos

#define SCB_ICSR_PENDSVCLR_Pos   (27U)

Bit 27.

Definition at line 118 of file scb_reg.h.

◆ SCB_ICSR_PENDSVCLR

#define SCB_ICSR_PENDSVCLR   ((uint32_t)1U << SCB_ICSR_PENDSVCLR_Pos)

wo Clear a pending PendSV.

Definition at line 120 of file scb_reg.h.

◆ SCB_ICSR_PENDSVSET_Pos

#define SCB_ICSR_PENDSVSET_Pos   (28U)

Bit 28.

Definition at line 121 of file scb_reg.h.

◆ SCB_ICSR_PENDSVSET

#define SCB_ICSR_PENDSVSET   ((uint32_t)1U << SCB_ICSR_PENDSVSET_Pos)

rw Pend PendSV (requests a context switch); reads 1 while pending.

Definition at line 123 of file scb_reg.h.

◆ SCB_SCR_SLEEPONEXIT_Pos

#define SCB_SCR_SLEEPONEXIT_Pos   (1U)

Bit 1.

Definition at line 129 of file scb_reg.h.

◆ SCB_SCR_SLEEPONEXIT

#define SCB_SCR_SLEEPONEXIT   ((uint32_t)1U << SCB_SCR_SLEEPONEXIT_Pos)

Sleep on return from an exception to Thread mode.

Definition at line 131 of file scb_reg.h.

◆ SCB_SCR_SLEEPDEEP_Pos

#define SCB_SCR_SLEEPDEEP_Pos   (2U)

Bit 2.

Definition at line 132 of file scb_reg.h.

◆ SCB_SCR_SLEEPDEEP

#define SCB_SCR_SLEEPDEEP   ((uint32_t)1U << SCB_SCR_SLEEPDEEP_Pos)

WFI/WFE enters deep sleep.

Definition at line 133 of file scb_reg.h.

◆ SCB_SCR_SEVONPEND_Pos

#define SCB_SCR_SEVONPEND_Pos   (4U)

Bit 4.

Definition at line 134 of file scb_reg.h.

◆ SCB_SCR_SEVONPEND

#define SCB_SCR_SEVONPEND   ((uint32_t)1U << SCB_SCR_SEVONPEND_Pos)

A pended interrupt wakes WFE.

Definition at line 135 of file scb_reg.h.

◆ SCB_CCR_NONBASETHRDENA_Pos

#define SCB_CCR_NONBASETHRDENA_Pos   (0U)

Bit 0.

Definition at line 141 of file scb_reg.h.

◆ SCB_CCR_NONBASETHRDENA

#define SCB_CCR_NONBASETHRDENA   ((uint32_t)1U << SCB_CCR_NONBASETHRDENA_Pos)

Allow Thread mode entry from any exception level.

Definition at line 143 of file scb_reg.h.

◆ SCB_CCR_USERSETMPEND_Pos

#define SCB_CCR_USERSETMPEND_Pos   (1U)

Bit 1.

Definition at line 144 of file scb_reg.h.

◆ SCB_CCR_USERSETMPEND

#define SCB_CCR_USERSETMPEND   ((uint32_t)1U << SCB_CCR_USERSETMPEND_Pos)

Allow unprivileged code to write STIR.

Definition at line 146 of file scb_reg.h.

◆ SCB_CCR_UNALIGN_TRP_Pos

#define SCB_CCR_UNALIGN_TRP_Pos   (3U)

Bit 3.

Definition at line 147 of file scb_reg.h.

◆ SCB_CCR_UNALIGN_TRP

#define SCB_CCR_UNALIGN_TRP   ((uint32_t)1U << SCB_CCR_UNALIGN_TRP_Pos)

Trap unaligned accesses.

Definition at line 148 of file scb_reg.h.

◆ SCB_CCR_DIV_0_TRP_Pos

#define SCB_CCR_DIV_0_TRP_Pos   (4U)

Bit 4.

Definition at line 149 of file scb_reg.h.

◆ SCB_CCR_DIV_0_TRP

#define SCB_CCR_DIV_0_TRP   ((uint32_t)1U << SCB_CCR_DIV_0_TRP_Pos)

Trap divide by zero.

Definition at line 150 of file scb_reg.h.

Referenced by faultEnable().

◆ SCB_CCR_BFHFNMIGN_Pos

#define SCB_CCR_BFHFNMIGN_Pos   (8U)

Bit 8.

Definition at line 151 of file scb_reg.h.

◆ SCB_CCR_BFHFNMIGN

#define SCB_CCR_BFHFNMIGN   ((uint32_t)1U << SCB_CCR_BFHFNMIGN_Pos)

Ignore data bus faults in HardFault, NMI and FAULTMASK handlers.

Definition at line 153 of file scb_reg.h.

◆ SCB_CCR_STKALIGN_Pos

#define SCB_CCR_STKALIGN_Pos   (9U)

Bit 9.

Definition at line 154 of file scb_reg.h.

◆ SCB_CCR_STKALIGN

#define SCB_CCR_STKALIGN   ((uint32_t)1U << SCB_CCR_STKALIGN_Pos)

Align the stack to 8 bytes on exception entry.

Definition at line 156 of file scb_reg.h.

◆ SCB_SHCSR_MEMFAULTACT_Pos

#define SCB_SHCSR_MEMFAULTACT_Pos   (0U)

Bit 0.

Definition at line 162 of file scb_reg.h.

◆ SCB_SHCSR_MEMFAULTACT

#define SCB_SHCSR_MEMFAULTACT   ((uint32_t)1U << SCB_SHCSR_MEMFAULTACT_Pos)

MemManage active.

Definition at line 164 of file scb_reg.h.

◆ SCB_SHCSR_BUSFAULTACT_Pos

#define SCB_SHCSR_BUSFAULTACT_Pos   (1U)

Bit 1.

Definition at line 165 of file scb_reg.h.

◆ SCB_SHCSR_BUSFAULTACT

#define SCB_SHCSR_BUSFAULTACT   ((uint32_t)1U << SCB_SHCSR_BUSFAULTACT_Pos)

BusFault active.

Definition at line 167 of file scb_reg.h.

◆ SCB_SHCSR_USGFAULTACT_Pos

#define SCB_SHCSR_USGFAULTACT_Pos   (3U)

Bit 3.

Definition at line 168 of file scb_reg.h.

◆ SCB_SHCSR_USGFAULTACT

#define SCB_SHCSR_USGFAULTACT   ((uint32_t)1U << SCB_SHCSR_USGFAULTACT_Pos)

UsageFault active.

Definition at line 170 of file scb_reg.h.

◆ SCB_SHCSR_SVCALLACT_Pos

#define SCB_SHCSR_SVCALLACT_Pos   (7U)

Bit 7.

Definition at line 171 of file scb_reg.h.

◆ SCB_SHCSR_SVCALLACT

#define SCB_SHCSR_SVCALLACT   ((uint32_t)1U << SCB_SHCSR_SVCALLACT_Pos)

SVCall active.

Definition at line 172 of file scb_reg.h.

◆ SCB_SHCSR_PENDSVACT_Pos

#define SCB_SHCSR_PENDSVACT_Pos   (10U)

Bit 10.

Definition at line 173 of file scb_reg.h.

◆ SCB_SHCSR_PENDSVACT

#define SCB_SHCSR_PENDSVACT   ((uint32_t)1U << SCB_SHCSR_PENDSVACT_Pos)

PendSV active.

Definition at line 174 of file scb_reg.h.

◆ SCB_SHCSR_SYSTICKACT_Pos

#define SCB_SHCSR_SYSTICKACT_Pos   (11U)

Bit 11.

Definition at line 175 of file scb_reg.h.

◆ SCB_SHCSR_SYSTICKACT

#define SCB_SHCSR_SYSTICKACT   ((uint32_t)1U << SCB_SHCSR_SYSTICKACT_Pos)

SysTick active.

Definition at line 177 of file scb_reg.h.

◆ SCB_SHCSR_USGFAULTPENDED_Pos

#define SCB_SHCSR_USGFAULTPENDED_Pos   (12U)

Bit 12.

Definition at line 178 of file scb_reg.h.

◆ SCB_SHCSR_USGFAULTPENDED

#define SCB_SHCSR_USGFAULTPENDED   ((uint32_t)1U << SCB_SHCSR_USGFAULTPENDED_Pos)

UsageFault pending.

Definition at line 180 of file scb_reg.h.

◆ SCB_SHCSR_MEMFAULTPENDED_Pos

#define SCB_SHCSR_MEMFAULTPENDED_Pos   (13U)

Bit 13.

Definition at line 181 of file scb_reg.h.

◆ SCB_SHCSR_MEMFAULTPENDED

#define SCB_SHCSR_MEMFAULTPENDED   ((uint32_t)1U << SCB_SHCSR_MEMFAULTPENDED_Pos)

MemManage pending.

Definition at line 183 of file scb_reg.h.

◆ SCB_SHCSR_BUSFAULTPENDED_Pos

#define SCB_SHCSR_BUSFAULTPENDED_Pos   (14U)

Bit 14.

Definition at line 184 of file scb_reg.h.

◆ SCB_SHCSR_BUSFAULTPENDED

#define SCB_SHCSR_BUSFAULTPENDED   ((uint32_t)1U << SCB_SHCSR_BUSFAULTPENDED_Pos)

BusFault pending.

Definition at line 186 of file scb_reg.h.

◆ SCB_SHCSR_SVCALLPENDED_Pos

#define SCB_SHCSR_SVCALLPENDED_Pos   (15U)

Bit 15.

Definition at line 187 of file scb_reg.h.

◆ SCB_SHCSR_SVCALLPENDED

#define SCB_SHCSR_SVCALLPENDED   ((uint32_t)1U << SCB_SHCSR_SVCALLPENDED_Pos)

SVCall pending.

Definition at line 189 of file scb_reg.h.

◆ SCB_SHCSR_MEMFAULTENA_Pos

#define SCB_SHCSR_MEMFAULTENA_Pos   (16U)

Bit 16.

Definition at line 190 of file scb_reg.h.

◆ SCB_SHCSR_MEMFAULTENA

#define SCB_SHCSR_MEMFAULTENA   ((uint32_t)1U << SCB_SHCSR_MEMFAULTENA_Pos)

Enable MemManage (otherwise it escalates to HardFault).

Definition at line 192 of file scb_reg.h.

Referenced by faultEnable().

◆ SCB_SHCSR_BUSFAULTENA_Pos

#define SCB_SHCSR_BUSFAULTENA_Pos   (17U)

Bit 17.

Definition at line 193 of file scb_reg.h.

◆ SCB_SHCSR_BUSFAULTENA

#define SCB_SHCSR_BUSFAULTENA   ((uint32_t)1U << SCB_SHCSR_BUSFAULTENA_Pos)

Enable BusFault (otherwise it escalates to HardFault).

Definition at line 195 of file scb_reg.h.

Referenced by faultEnable().

◆ SCB_SHCSR_USGFAULTENA_Pos

#define SCB_SHCSR_USGFAULTENA_Pos   (18U)

Bit 18.

Definition at line 196 of file scb_reg.h.

◆ SCB_SHCSR_USGFAULTENA

#define SCB_SHCSR_USGFAULTENA   ((uint32_t)1U << SCB_SHCSR_USGFAULTENA_Pos)

Enable UsageFault (otherwise it escalates to HardFault).

Definition at line 198 of file scb_reg.h.

Referenced by faultEnable().

◆ SCB_CFSR_IACCVIOL_Pos

#define SCB_CFSR_IACCVIOL_Pos   (0U)

Bit 0.

Definition at line 204 of file scb_reg.h.

◆ SCB_CFSR_IACCVIOL

#define SCB_CFSR_IACCVIOL   ((uint32_t)1U << SCB_CFSR_IACCVIOL_Pos)

MemManage: instruction access violation.

Definition at line 206 of file scb_reg.h.

◆ SCB_CFSR_DACCVIOL_Pos

#define SCB_CFSR_DACCVIOL_Pos   (1U)

Bit 1.

Definition at line 207 of file scb_reg.h.

◆ SCB_CFSR_DACCVIOL

#define SCB_CFSR_DACCVIOL   ((uint32_t)1U << SCB_CFSR_DACCVIOL_Pos)

MemManage: data access violation; MMFAR holds the address if MMARVALID.

Definition at line 209 of file scb_reg.h.

◆ SCB_CFSR_MUNSTKERR_Pos

#define SCB_CFSR_MUNSTKERR_Pos   (3U)

Bit 3.

Definition at line 210 of file scb_reg.h.

◆ SCB_CFSR_MUNSTKERR

#define SCB_CFSR_MUNSTKERR   ((uint32_t)1U << SCB_CFSR_MUNSTKERR_Pos)

MemManage: fault while unstacking on exception return.

Definition at line 212 of file scb_reg.h.

◆ SCB_CFSR_MSTKERR_Pos

#define SCB_CFSR_MSTKERR_Pos   (4U)

Bit 4.

Definition at line 213 of file scb_reg.h.

◆ SCB_CFSR_MSTKERR

#define SCB_CFSR_MSTKERR   ((uint32_t)1U << SCB_CFSR_MSTKERR_Pos)

MemManage: fault while stacking on exception entry.

Definition at line 215 of file scb_reg.h.

Referenced by faultCapture().

◆ SCB_CFSR_MLSPERR_Pos

#define SCB_CFSR_MLSPERR_Pos   (5U)

Bit 5.

Definition at line 216 of file scb_reg.h.

◆ SCB_CFSR_MLSPERR

#define SCB_CFSR_MLSPERR   ((uint32_t)1U << SCB_CFSR_MLSPERR_Pos)

MemManage: fault during lazy FP state preservation.

Definition at line 218 of file scb_reg.h.

◆ SCB_CFSR_MMARVALID_Pos

#define SCB_CFSR_MMARVALID_Pos   (7U)

Bit 7.

Definition at line 219 of file scb_reg.h.

◆ SCB_CFSR_MMARVALID

#define SCB_CFSR_MMARVALID   ((uint32_t)1U << SCB_CFSR_MMARVALID_Pos)

MMFAR holds a valid fault address.

Definition at line 221 of file scb_reg.h.

◆ SCB_CFSR_IBUSERR_Pos

#define SCB_CFSR_IBUSERR_Pos   (8U)

Bit 8.

Definition at line 222 of file scb_reg.h.

◆ SCB_CFSR_IBUSERR

#define SCB_CFSR_IBUSERR   ((uint32_t)1U << SCB_CFSR_IBUSERR_Pos)

BusFault: instruction fetch.

Definition at line 224 of file scb_reg.h.

◆ SCB_CFSR_PRECISERR_Pos

#define SCB_CFSR_PRECISERR_Pos   (9U)

Bit 9.

Definition at line 225 of file scb_reg.h.

◆ SCB_CFSR_PRECISERR

#define SCB_CFSR_PRECISERR   ((uint32_t)1U << SCB_CFSR_PRECISERR_Pos)

BusFault: precise data access; BFAR holds the address if BFARVALID.

Definition at line 227 of file scb_reg.h.

◆ SCB_CFSR_IMPRECISERR_Pos

#define SCB_CFSR_IMPRECISERR_Pos   (10U)

Bit 10.

Definition at line 228 of file scb_reg.h.

◆ SCB_CFSR_IMPRECISERR

#define SCB_CFSR_IMPRECISERR   ((uint32_t)1U << SCB_CFSR_IMPRECISERR_Pos)

BusFault: imprecise data access (no address).

Definition at line 230 of file scb_reg.h.

◆ SCB_CFSR_UNSTKERR_Pos

#define SCB_CFSR_UNSTKERR_Pos   (11U)

Bit 11.

Definition at line 231 of file scb_reg.h.

◆ SCB_CFSR_UNSTKERR

#define SCB_CFSR_UNSTKERR   ((uint32_t)1U << SCB_CFSR_UNSTKERR_Pos)

BusFault: fault while unstacking on exception return.

Definition at line 233 of file scb_reg.h.

◆ SCB_CFSR_STKERR_Pos

#define SCB_CFSR_STKERR_Pos   (12U)

Bit 12.

Definition at line 234 of file scb_reg.h.

◆ SCB_CFSR_STKERR

#define SCB_CFSR_STKERR   ((uint32_t)1U << SCB_CFSR_STKERR_Pos)

BusFault: fault while stacking on exception entry.

Definition at line 236 of file scb_reg.h.

Referenced by faultCapture().

◆ SCB_CFSR_LSPERR_Pos

#define SCB_CFSR_LSPERR_Pos   (13U)

Bit 13.

Definition at line 237 of file scb_reg.h.

◆ SCB_CFSR_LSPERR

#define SCB_CFSR_LSPERR   ((uint32_t)1U << SCB_CFSR_LSPERR_Pos)

BusFault: fault during lazy FP state preservation.

Definition at line 239 of file scb_reg.h.

◆ SCB_CFSR_BFARVALID_Pos

#define SCB_CFSR_BFARVALID_Pos   (15U)

Bit 15.

Definition at line 240 of file scb_reg.h.

◆ SCB_CFSR_BFARVALID

#define SCB_CFSR_BFARVALID   ((uint32_t)1U << SCB_CFSR_BFARVALID_Pos)

BFAR holds a valid fault address.

Definition at line 242 of file scb_reg.h.

◆ SCB_CFSR_UNDEFINSTR_Pos

#define SCB_CFSR_UNDEFINSTR_Pos   (16U)

Bit 16.

Definition at line 243 of file scb_reg.h.

◆ SCB_CFSR_UNDEFINSTR

#define SCB_CFSR_UNDEFINSTR   ((uint32_t)1U << SCB_CFSR_UNDEFINSTR_Pos)

UsageFault: undefined instruction.

Definition at line 245 of file scb_reg.h.

◆ SCB_CFSR_INVSTATE_Pos

#define SCB_CFSR_INVSTATE_Pos   (17U)

Bit 17.

Definition at line 246 of file scb_reg.h.

◆ SCB_CFSR_INVSTATE

#define SCB_CFSR_INVSTATE   ((uint32_t)1U << SCB_CFSR_INVSTATE_Pos)

UsageFault: invalid EPSR state (for example a Thumb bit of 0).

Definition at line 248 of file scb_reg.h.

◆ SCB_CFSR_INVPC_Pos

#define SCB_CFSR_INVPC_Pos   (18U)

Bit 18.

Definition at line 249 of file scb_reg.h.

◆ SCB_CFSR_INVPC

#define SCB_CFSR_INVPC   ((uint32_t)1U << SCB_CFSR_INVPC_Pos)

UsageFault: invalid PC load or EXC_RETURN.

Definition at line 251 of file scb_reg.h.

◆ SCB_CFSR_NOCP_Pos

#define SCB_CFSR_NOCP_Pos   (19U)

Bit 19.

Definition at line 252 of file scb_reg.h.

◆ SCB_CFSR_NOCP

#define SCB_CFSR_NOCP   ((uint32_t)1U << SCB_CFSR_NOCP_Pos)

UsageFault: coprocessor (FPU) access while disabled in CPACR.

Definition at line 254 of file scb_reg.h.

◆ SCB_CFSR_UNALIGNED_Pos

#define SCB_CFSR_UNALIGNED_Pos   (24U)

Bit 24.

Definition at line 255 of file scb_reg.h.

◆ SCB_CFSR_UNALIGNED

#define SCB_CFSR_UNALIGNED   ((uint32_t)1U << SCB_CFSR_UNALIGNED_Pos)

UsageFault: unaligned access with CCR.UNALIGN_TRP set.

Definition at line 257 of file scb_reg.h.

◆ SCB_CFSR_DIVBYZERO_Pos

#define SCB_CFSR_DIVBYZERO_Pos   (25U)

Bit 25.

Definition at line 258 of file scb_reg.h.

◆ SCB_CFSR_DIVBYZERO

#define SCB_CFSR_DIVBYZERO   ((uint32_t)1U << SCB_CFSR_DIVBYZERO_Pos)

UsageFault: divide by zero with CCR.DIV_0_TRP set.

Definition at line 260 of file scb_reg.h.

◆ SCB_HFSR_VECTTBL_Pos

#define SCB_HFSR_VECTTBL_Pos   (1U)

Bit 1.

Definition at line 266 of file scb_reg.h.

◆ SCB_HFSR_VECTTBL

#define SCB_HFSR_VECTTBL   ((uint32_t)1U << SCB_HFSR_VECTTBL_Pos)

Bus fault while reading the vector table.

Definition at line 268 of file scb_reg.h.

◆ SCB_HFSR_FORCED_Pos

#define SCB_HFSR_FORCED_Pos   (30U)

Bit 30.

Definition at line 269 of file scb_reg.h.

◆ SCB_HFSR_FORCED

#define SCB_HFSR_FORCED   ((uint32_t)1U << SCB_HFSR_FORCED_Pos)

A configurable fault escalated to HardFault; see CFSR.

Definition at line 271 of file scb_reg.h.

◆ SCB_HFSR_DEBUGEVT_Pos

#define SCB_HFSR_DEBUGEVT_Pos   (31U)

Bit 31.

Definition at line 272 of file scb_reg.h.

◆ SCB_HFSR_DEBUGEVT

#define SCB_HFSR_DEBUGEVT   ((uint32_t)1U << SCB_HFSR_DEBUGEVT_Pos)

Debug event.

Definition at line 273 of file scb_reg.h.

◆ SCB_SHPR1_PRI_4_Pos

#define SCB_SHPR1_PRI_4_Pos   (0U)

Bits 7:0.

Definition at line 279 of file scb_reg.h.

Referenced by nvicSetSystemHandlerPriority().

◆ SCB_SHPR1_PRI_4_Msk

#define SCB_SHPR1_PRI_4_Msk   ((uint32_t)0xFFU << SCB_SHPR1_PRI_4_Pos)

MemManage priority.

Definition at line 280 of file scb_reg.h.

Referenced by nvicSetSystemHandlerPriority().

◆ SCB_SHPR1_PRI_5_Pos

#define SCB_SHPR1_PRI_5_Pos   (8U)

Bits 15:8.

Definition at line 281 of file scb_reg.h.

Referenced by nvicSetSystemHandlerPriority().

◆ SCB_SHPR1_PRI_5_Msk

#define SCB_SHPR1_PRI_5_Msk   ((uint32_t)0xFFU << SCB_SHPR1_PRI_5_Pos)

BusFault priority.

Definition at line 282 of file scb_reg.h.

Referenced by nvicSetSystemHandlerPriority().

◆ SCB_SHPR1_PRI_6_Pos

#define SCB_SHPR1_PRI_6_Pos   (16U)

Bits 23:16.

Definition at line 283 of file scb_reg.h.

Referenced by nvicSetSystemHandlerPriority().

◆ SCB_SHPR1_PRI_6_Msk

#define SCB_SHPR1_PRI_6_Msk   ((uint32_t)0xFFU << SCB_SHPR1_PRI_6_Pos)

UsageFault priority.

Definition at line 284 of file scb_reg.h.

Referenced by nvicSetSystemHandlerPriority().

◆ SCB_SHPR2_PRI_11_Pos

#define SCB_SHPR2_PRI_11_Pos   (24U)

Bits 31:24.

Definition at line 285 of file scb_reg.h.

Referenced by nvicSetSystemHandlerPriority().

◆ SCB_SHPR2_PRI_11_Msk

#define SCB_SHPR2_PRI_11_Msk   ((uint32_t)0xFFU << SCB_SHPR2_PRI_11_Pos)

SVCall priority.

Definition at line 286 of file scb_reg.h.

Referenced by nvicSetSystemHandlerPriority().

◆ SCB_SHPR3_PRI_14_Pos

#define SCB_SHPR3_PRI_14_Pos   (16U)

Bits 23:16.

Definition at line 287 of file scb_reg.h.

Referenced by nvicSetSystemHandlerPriority().

◆ SCB_SHPR3_PRI_14_Msk

#define SCB_SHPR3_PRI_14_Msk   ((uint32_t)0xFFU << SCB_SHPR3_PRI_14_Pos)

PendSV priority.

Definition at line 288 of file scb_reg.h.

Referenced by nvicSetSystemHandlerPriority().

◆ SCB_SHPR3_PRI_15_Pos

#define SCB_SHPR3_PRI_15_Pos   (24U)

Bits 31:24.

Definition at line 289 of file scb_reg.h.

Referenced by nvicSetSystemHandlerPriority().

◆ SCB_SHPR3_PRI_15_Msk

#define SCB_SHPR3_PRI_15_Msk   ((uint32_t)0xFFU << SCB_SHPR3_PRI_15_Pos)

SysTick priority.

Definition at line 290 of file scb_reg.h.

Referenced by nvicSetSystemHandlerPriority().

◆ SCB_CPACR_CP10_Pos

#define SCB_CPACR_CP10_Pos   (20U)

Bits 21:20.

Definition at line 295 of file scb_reg.h.

◆ SCB_CPACR_CP10_Msk

#define SCB_CPACR_CP10_Msk   ((uint32_t)0x3U << SCB_CPACR_CP10_Pos)

rw FPU access (CP10); 0b11 = full.

Reset_Handler enables it.

Definition at line 297 of file scb_reg.h.

◆ SCB_CPACR_CP11_Pos

#define SCB_CPACR_CP11_Pos   (22U)

Bits 23:22.

Definition at line 298 of file scb_reg.h.

◆ SCB_CPACR_CP11_Msk

#define SCB_CPACR_CP11_Msk   ((uint32_t)0x3U << SCB_CPACR_CP11_Pos)

rw FPU access (CP11); must match CP10.

Definition at line 300 of file scb_reg.h.

◆ EXC_RETURN_HANDLER

#define EXC_RETURN_HANDLER   (0xFFFFFFF1UL)

Handler mode, MSP, basic frame.

Definition at line 307 of file scb_reg.h.

◆ EXC_RETURN_THREAD_MSP

#define EXC_RETURN_THREAD_MSP   (0xFFFFFFF9UL)

Thread mode, MSP, basic frame.

Definition at line 308 of file scb_reg.h.

◆ EXC_RETURN_THREAD_PSP

#define EXC_RETURN_THREAD_PSP   (0xFFFFFFFDUL)

Thread mode, PSP, basic frame.

Definition at line 309 of file scb_reg.h.

◆ EXC_RETURN_HANDLER_FPU

#define EXC_RETURN_HANDLER_FPU   (0xFFFFFFE1UL)

Handler mode, MSP, extended frame.

Definition at line 310 of file scb_reg.h.

◆ EXC_RETURN_THREAD_MSP_FPU

#define EXC_RETURN_THREAD_MSP_FPU   (0xFFFFFFE9UL)

Thread mode, MSP, extended frame.

Definition at line 311 of file scb_reg.h.

◆ EXC_RETURN_THREAD_PSP_FPU

#define EXC_RETURN_THREAD_PSP_FPU   (0xFFFFFFEDUL)

Thread mode, PSP, extended frame.

Definition at line 312 of file scb_reg.h.