13.07.2015 Views

Cortex-M0+ Devices Generic User Guide - Keil

Cortex-M0+ Devices Generic User Guide - Keil

Cortex-M0+ Devices Generic User Guide - Keil

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The <strong>Cortex</strong>-<strong>M0+</strong> Processor2.1 Programmers modelThis section describes the <strong>Cortex</strong>-<strong>M0+</strong> programmers model. In addition to the individual coreregister descriptions, it contains information about the processor modes, optional privilegelevels for software execution, and stacks.2.1.1 Processor modes and privilege levels for software executionThe processor modes are:Thread modeHandler modeExecutes application software. The processor enters Thread mode when itcomes out of reset.Handles exceptions. The processor returns to Thread mode when it hasfinished all exception processing.The optional privilege levels for software execution are:UnprivilegedPrivilegedThe software:• has limited access to system registers using the MSR and MRSinstructions, and cannot use the CPS instruction to mask interrupts• cannot access the system timer, NVIC, or system control block• might have restricted access to memory or peripherals.Unprivileged software executes at the unprivileged level.The software can use all the instructions and has access to all resources.Privileged software executes at the privileged level.In Thread mode, the CONTROL register controls whether software execution is privileged orunprivileged, see CONTROL register on page 2-8. In Handler mode, software execution isalways privileged.Only privileged software can write to the CONTROL register to change the privilege level forsoftware execution in Thread mode. Unprivileged software can use the SVC instruction to makea Supervisor Call to transfer control to privileged software.2.1.2 StacksThe processor uses a full descending stack. This means the stack pointer indicates the laststacked item on the stack memory. When the processor pushes a new item onto the stack, itdecrements the stack pointer and then writes the item to the new memory location. Theprocessor implements two stacks, the main stack and the process stack, with independent copiesof the stack pointer, see Stack Pointer on page 2-4.ARM DUI 0662A Copyright © 2012 ARM. All rights reserved. 2-2ID041812Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!