The SDK provides an implementation of a FreeRTOS port to nRF5. The port supports tickless idle mode.
SVC usage
SVC 0 is used during initialization of the system. No further supervisor calls are used after the first task is started.
Cooperation with the SoftDevice
The port is fully compatible with all SoftDevice implementations, which means that it never blocks any global interrupt flags when it has been compiled with a SoftDevice.
To make sure that interrupts are compatible, the port uses the BASEPRI register to block interrupts below the designed level.
Limitations
You should be aware of the following limitations when using the nRF52 port of FreeRTOS with a SoftDevice:
- configLIBRARY_LOWEST_INTERRUPT_PRIORITY must be set to the same value as NRF_APP_PRIORITY_LOW.
- The syscall priority must be higher than or equal to the lowest application priority. To ensure this, set configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY to a value equal to or higher than NRF_APP_PRIORITY_LOW.
- It has not been tested if starting any interrupt before the FreeRTOS initialization is safe. Interrupts that use FreeRTOS functions from a priority level higher or equal to NRF_APP_PRIORITY_HIGH might break system initialization, because this level is higher than the SVC level. Therefore, start the system as quickly as possible and do the rest of the initialization in the thread.
Examples
The following example applications demonstrate the use of FreeRTOS: