| nRF5 SDK v12.0.0 |

Choose documentation: | nRF5 SDK | S130 SoftDevice API | S132 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
FreeRTOS support

The SDK provides an implementation of a FreeRTOS port to nRF5. The port supports tickless idle mode.

# SVC usage

This information applies to the nRF52 Series only.

On nRF52 Series devices, 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 nRF51 port uses critical region functions. The nRF52 port uses the BASEPRI register to block interrupts below the designed level.

# Limitations

This information applies to the nRF52 Series only.

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:

- Blinky FreeRTOS Example
- Heart Rate Application with FreeRTOS