UM10462
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2016. All rights reserved.
User manual
Rev. 5.5 — 21 December 2016
439 of 523
NXP Semiconductors
UM10462
Chapter 24: LPC11U3x/2x/1x Appendix ARM Cortex-M0
Handler mode always uses the MSP, so the processor ignores explicit writes to the active
stack pointer bit of the CONTROL register when in Handler mode. The exception entry
and return mechanisms update the CONTROL register.
In an OS environment, it is recommended 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, use the
MSR
instruction to set the Active stack pointer bit to 1, see
.
Remark:
When changing the stack pointer, software must use an
ISB
instruction
immediately after the
MSR
instruction. This ensures that instructions after the ISB execute
using the new stack pointer. See
24.3.1.4 Exceptions and interrupts
The Cortex-M0 processor supports interrupts and system exceptions. The processor and
the
Nested Vectored Interrupt Controller
(NVIC) prioritize and handle all exceptions. An
interrupt or exception changes the normal flow of software control. The processor uses
handler mode to handle all exceptions except for reset. See
and
for more information.
The NVIC registers control interrupt handling. See
for more
information.
24.3.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. Instruction memory and
Private
Peripheral Bus
(PPB) accesses are always little-endian. See
more information.
24.3.1.6 The Cortex Microcontroller Software Interface Standard
ARM provides the
Cortex Microcontroller Software Interface Standard
(CMSIS) for
programming Cortex-M0 microcontrollers. The CMSIS is an integrated part of the device
driver library.
Table 419. CONTROL register bit assignments
Bits
Name
Function
[31:2]
-
Reserved
[1]
Active stack
pointer
Defines the current stack:
0 = MSP is the current stack pointer
1 = PSP is the current stack pointer.
In Handler mode this bit reads as zero and ignores writes.
[0]
-
Reserved.