The Cortex-M4 Processor
ARM DUI 0553A
Copyright © 2010 ARM. All rights reserved.
2-10
ID121610
Non-Confidential
In an OS environment, ARM recommends that threads running in Thread mode use the process
stack and the kernel and exception handlers 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 Active stack pointer bit to 1, see
.
•
perform an exception return to Thread mode with the appropriate EXC_RETURN value,
see
Note
When changing the stack pointer, software must use an
ISB
instruction immediately after the
MSR
instruction. This ensures that instructions after the
ISB
instruction execute using the new stack
pointer. See
2.1.4
Exceptions and interrupts
The Cortex-M4 processor supports interrupts and system exceptions. The processor and the
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
Nested Vectored Interrupt Controller
for more information.
2.1.5
Data types
The processor:
•
supports the following data types:
—
32-bit words
—
16-bit halfwords
—
8-bit bytes
•
manages all data memory accesses as little-endian or big-endian. Instruction memory and
Private Peripheral Bus
(PPB) accesses are always performed as little-endian. See
Memory regions, types and attributes
2.1.6
The Cortex Microcontroller Software Interface Standard
For a Cortex-M4 microcontroller system, the
Cortex Microcontroller Software Interface
Standard
(CMSIS) defines:
•
a common way to:
—
access peripheral registers
—
define exception vectors.
•
the names of:
—
the registers of the core peripherals
—
the core exception vectors.
•
a device-independent interface for RTOS kernels, including a debug channel.
The CMSIS includes address definitions and data structures for the core peripherals in the
Cortex-M4 processor.