Programming Model
59
SLAU356I – March 2015 – Revised June 2019
Copyright © 2015–2019, Texas Instruments Incorporated
Cortex-M4F Processor
1.3.4.9
Register 20: Control Register (CONTROL)
The CONTROL register controls the stack used and the privilege level for software execution when the
processor is in Thread mode, and indicates whether the FPU state is active. This register is only
accessible in privileged mode.
Handler mode always uses the MSP, so the processor ignores explicit writes to the ASP bit of the
CONTROL register when in Handler mode. The exception entry and return mechanisms automatically
update the CONTROL register based on the EXC_RETURN value (see
). In an Operating
system (OS), for example TI-RTOS environment, threads running in Thread mode should use the process
stack and the kernel and exception handlers should use the main stack. By default, Thread mode uses the
MSP. To switch the stack pointer used in Thread mode to the PSP, either use the MSR instruction to set
the ASP bit, as detailed in the Cortex-M4 instruction set chapter in the
Cortex-M4 Devices Generic User
, or perform an exception return to Thread mode with the appropriate EXC_RETURN value, as
shown in
. On reset, the CONTROL register is cleared.
NOTE:
When changing the stack pointer, software must use an ISB instruction immediately after
the MSR instruction, ensuring that instructions after the ISB execute use the new stack
pointer. See the Cortex-M4 instruction set chapter in the
Cortex-M4 Devices Generic User
1.3.4.10 Register 21: Floating-Point Status Control (FPSC)
The FPSC register provides all necessary user-level control of the floating-point system. On Reset the
FPSCR register is Undefined.
1.3.5 Exceptions and Interrupts
The Cortex-M4F processor supports interrupts and system exceptions. The processor and the Nested
Vectored Interrupt Controller (NVIC) prioritize and handle all exceptions. An exception changes the normal
flow of software control. The processor uses Handler mode to handle all exceptions except for reset. See
for more information.
The NVIC registers control interrupt handling. See
for more information.
1.3.6 Data Types
The Cortex-M4F supports 32-bit words, 16-bit halfwords, and 8-bit bytes. The processor also supports 64-
bit data transfer instructions. All instruction and data memory accesses are little endian. See
for more information.
1.4
Memory Model
This section describes the processor memory map, the behavior of memory accesses, and the bit-banding
features. The processor has a fixed memory map that provides up to 4GB of addressable memory. The
regions for SRAM and peripherals include bit-band regions. Bit-banding provides atomic operations to bit
data (see
).
The processor reserves regions of the Private Peripheral Bus (PPB) address range for core peripheral
registers (see the
Cortex-M4 Peripherals
chapter).
NOTE:
Within the memory map, attempts to read or write addresses in reserved spaces result in a
bus fault.
NOTE:
For details about the memory map of individual peripherals and valid memory range, see the
device-specific data sheet.