RTX support

nRF5 SDK v10.0.0

nRF51 SDK v10.0.0
This information applies to the following SoftDevices: S110, S120, 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 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.

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:


Please send us your feedback about the documentation! For technical questions, visit the Nordic Developer Zone .