This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

FreeRTOS tickless idle for NRF53

I'm running FreeRTOS with default tickless idle mode (CPU is woken up by SysTick interrupt) on NET_CPU core.

If the TAD_S module (Trace and debug control) is not enabled by the APP_CPU core, waking up the NET_CPU with SysTick interrupt does not seem to work.

When the TAD_S is enabled by the APP_CPU core everything works fine.

Why is it that ?

The below instructions are sufficient by the APP_CPU core in order to make the tickless idle mode working fine by the NET_CPU side.

NRF_TAD_S->ENABLE = TAD_ENABLE_ENABLE_Msk;
NRF_TAD_S->CLOCKSTART = TAD_CLOCKSTART_START_Msk;

  • Hi,

    Please be aware that we do not officially support FreeRTOS or any RTOS other than Zephyr RTOS on the nRF53 Series. The Zephyr RTOS is included in nRF Connect SDK, which we recommend using when developing applications for nRF5340.

    This could be hardware related. It seems like the SysTick clock on the network core has a dependency on TAD_S clock. When TAD_S is disabled, is the SysTick interrupt being pended? If it is not pended, it might point to hardware related behavior. If it is pended and not serviced, this is most likely caused by something else.

    Edit: I asked our developers about this. SysTick timer is suspended when the processor goes to sleep. It is recommended to use another timer, like an RTC for OS tick purposes.

    Best regards,

    Marte

  • Thanks for the response. The official FreeRTOS port for the ARM33 which is used utilizes SysTick timer for the purpose of FreeRTOS. And then tickless idle mode uses the SysTick interrupt to wake up the CPU from the sleep state. If you are saying the SysTick timer is suspended in CPU sleep state then probably something else wakes up the NET_CPU when I have the TAD module enabled by the APP_CPU. Can you answer what is the TAD_S module dependency to NET_CPU sleep state ?

  • Hi,

    In debug mode, the HF clock is always on. This might be the reason why SysTick was still working in your case.

    For tickless on nRF5340 you can check out RTC Tick event.

    Best regards,

    Marte

Related