Keil Logo

Run in Privileged Mode

RTX Library version for Cortex™-M devices allows to select the running mode of all user tasks. User tasks may run in two modes:

  • Unprivileged - Protected mode or
  • Privileged - Unprotected mode.

In privileged mode user may access and configure the system and control registers like NVIC interrupt controller etc. This is however not allowed from unprivileged mode. An access to NVIC registers from unprivileged mode will result in Hard Fault.

  • OS_RUNPRIV enables running of all tasks in Privileged mode. It must be set to 1 to enable it or 0 to disable it. It is disabled by default.
    #define OS_RUNPRIV   1
    

You can enable the privileged mode for old projects. The existing code will run without any modifications when RTX_Config.c configuration file is replaced with a new one and a project is recompiled for a new Cortex™-M RTX Kernel library. Tasks are not protected in privileged mode and you may configure the system for example the interrupts from any task.

Privileged mode is disabled by default. This allows all tasks to run in protected mode. The tasks are not allowed to change system settings, change interrupts etc. The user has two options:

  • run the configuration code in privileged mode as __svc function from the task
  • run the configuration code before the kernel is started when the device is still running in privileged mode.

 

  • The RTX Kernel library for ARM7™/ARM9™ does not allow this option because of a different concept.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.