Atmel Xplained Pro Evaluation Kit ATSAM4E-XPRO ATSAM4E-XPRO Datenbogen

Produktcode
ATSAM4E-XPRO
Seite von 1506
47
SAM4E [DATASHEET]
Atmel-11157D-ATARM-SAM4E16-SAM4E8-Datasheet_12-Jun-14
12.4
Cortex-M4 Models
12.4.1 Programmers Model
This section describes the Cortex-M4 programmers model. In addition to the individual core register descriptions, it
contains information about the processor modes and privilege levels for software execution and stacks.
12.4.1.1  Processor Modes and Privilege Levels for Software Execution
The processor modes are:
Thread mode 
Used to execute application software. The processor enters the Thread mode when it comes out of reset.
Handler mode
Used to handle exceptions. The processor returns to the Thread mode when it has finished exception 
processing.
The privilege levels for software execution are:
Unprivileged
The software:
̶
Has limited access to the MSR and MRS instructions, and cannot use the CPS instruction
̶
Cannot access the System Timer, NVIC, or System Control Block
̶
Might have a restricted access to memory or peripherals.
Unprivileged software executes at the unprivileged level.
Privileged 
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 the software execution is privileged or unprivileged, see
. In Handler mode, software execution is always privileged.
Only privileged software can write to the Control Register to change the privilege level for software execution in
Thread mode. Unprivileged software can use the SVC instruction to make a supervisor call to transfer control to
privileged software.
12.4.1.2  Stacks
The processor uses a full descending stack. This means the stack pointer holds the address of the last stacked
item in memory When the processor pushes a new item onto the stack, it decrements the stack pointer and then
writes the item to the new memory location. The processor implements two stacks, the main stack and the process
stack
, with a pointer for each held in independent registers, se
.
In Thread mode, the Control Register controls whether the processor uses the main stack or the process stack,
see 
In Handler mode, the processor always uses the main stack. 
The options for processor operations are:
Note:
1.
See 
Table 12-1.
Summary of processor mode, execution privilege level, and stack use options
Processor Mode
Used to Execute
Privilege Level forSoftware Execution
Stack Used
Thread
Applications
Privileged or unprivileged
Main stack or process stack
Handler
Exception handlers
Always privileged
Main stack