![]() |
MKM34Z256VLx7 Bare Metal Software Drivers
R4.1.6
Reference Manual
|
The ARM Cortex M0+ core provides optional privilege levels for software execution:
An unprivileged software can use the SVC_Call macro to initiate a supervisor call to transfer control to a privileged software. In addition to execution levels the ARM Cortex M0+ implements two stacks, the main stack and the process stack, with independent copies of the stack pointer. This example shows typical use of the supervisor call to switch ARM Cortex M0+ execution from thread user (unprivileged) mode to the handler (privileged) mode. The device enters the thread (privileged) execution mode after POR with main stack selected. After supervisor callback function is initialized, using SVC_InstallCallback function, the software switches execution mode to the thread user (unprivileged) and to use process stack. Then the user_function()
is called from within a loop. The user_function()
toggles two LEDs by initiating a supervisor call. The LEDs are toggled by the svc_callback()
function executed in the handler (privileged) mode. After callback function terminates the ARM Cortex M0+ enters thread user (unprivileged) mode and the execution of the user_function()
resumes.
IAR EWARM 7.40.7 | KEIL uVision 5.15 | CrossWorks 3.6 | ATOLLIC TrueStudio 5.3.0 | Kinetis Design Studio 3.0.0 |
---|---|---|---|---|
♦ | ♦ | ♦ | ♦ | ♦ |