Cortex-M4 privileged mode

sterossi84 wrote on Friday, July 11, 2014:

Hi guys,

I’m going to develop an application running under Cortex-M4F processor (STM32F4xx) and FreeRTOS with - most likely - NO MPU support.

My question is the following:
The application tasks that are created using FreeRTOS runs in Cortex-M4 privileged mode so they can access NVIC registers or not?

The application will run a time-critical ISR that will have a priority greater than configMAX_SYSCALL_INTERRUPT_PRIORITY so it’s not maskable by kernel.
An application task is in charge to enable/disable/mask this ISR and my wish is to use NVIC_EnableIRQ - NVIC_DisableIRQ to manage these operations. To do so it’s fundamental that software task run in privileged mode (nPRIV bit of CONTROL core register = 0) because in un-privileged mode task cannot access NVIC registers.

Thanks in advance for your support.

davedoors wrote on Friday, July 11, 2014:

Most FreeRTOS applications run without the MPU so tasks run will full privilege. You won’t have a problem.

sterossi84 wrote on Friday, July 11, 2014:

Ok. Glad to know that things works in this way.
Thanks a lot for your answer Mr Dave =)