nRF51 SDK - S120 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
RTX Support

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.


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

  • nRF51 does not have a SysTick timer. Therefore, RTC1 is used instead.
  • 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 S110 nRF51822 (v1.2):

    Interrupt S110 (CPU cycles)RTX (CPU cycles)
    Open peripheral interrupt 50 < 20
    Blocked or restricted peripheral interrupt 63 < 20
    Application SVC interrupt 14 ≈ 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.


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

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:

Blinky RTX Example