XMC4500 Tip of the day: Cortex-M4 Processor Mode and Privilege Levels

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
The Cortex - M4 processor has the following operation modes during software execution.

• Thread mode - Used to execute application software. The processor enters Thread mode when it
comes out of reset.

• Handler mode - Used to handle exceptions. The processor returns to Thread mode when it has
finished all exception processing.

The privilege levels for software execution are:

• Unprivileged - Unprivileged software executes at the unprivileged level.
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 restricted access to memory or peripherals.

• Privileged
Privileged software executes at the privileged level.
The software can use all the instructions and has access to all resources.
0 Likes
1 Reply
User10696
Level 4
Level 4
First solution authored
In my application running with RTX I would like to change to unprivileged mode after the initialization (interrupt vectors, etc.) has been done.
Is this a good idea?
How can I change the mode from C code? Is there a XMC-library API for this?
0 Likes