nRF5 SDK  v12.2.0
Choose documentation:
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
RTX support
This information applies to the nRF51 Series only.
This information applies to the following SoftDevice: S130

The SDK provides an implementation of an extension to ARM Keil RTX that is referred to as tickless mode. It allows waking up the MCU only when it is needed.

Limitations

You should be aware of the following limitations when using RTX:

  • RTC1 is used as tick timer.
  • To provide the early wake-up mechanism, the rtos_suspend variable must be cleared in every interrupt handler that uses system services. See Examples for a code example.
  • All interrupts are passed to the application through the SoftDevice, which generates additional interrupt latency. See the SoftDevice and RTX specification for more information.

    The following table lists the additional latency according to the specifications for RTX (V4.74) and the S13x SoftDevice(v1.0.0):

    Interrupt S13x (CPU cycles)RTX (CPU cycles)
    Open peripheral interrupt 54 < 20
    Blocked or restricted peripheral interrupt N/A < 20
    Application SVC interrupt 59 ≈ 35

Cooperation with the SoftDevice

RTX shares the SVC interrupt with the SoftDevice. Therefore, it works on the same interrupt priority (UpperStack) as the SoftDevice API functions.

Examples

This example shows how to use the system function in interrupt handlers.

Warning
You must always clear the rtos_suspend variable in interrupt handlers that use RTX functions. Not clearing it might cause undefined behaviour.
void ***_IRQHandler(void);
{
/**
*implementation of handler
*/
rtos_suspend = 0;
osSignalSet (thread_id, SIGNAL); //example of system function
}

The following example applications demonstrate the use of RTX: