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

How to enable and disable FreeRTOS tickless idle? Anyway to wakeup when there is BLE activities detected?

How to enable and disable FreeRTOS tickless idle(RTC or Systick)? Anyway to wakeup from tickless idle mode when there is BLE activities detected?

Setup:

1. nRF5_SDK_15.2.0_9412b96

2. Window 10

3. PCA10056

  • How to enable and disable FreeRTOS tickless idle(RTC or Systick)?

     tickless idle functionality is enabled by defining configUSE_TICKLESS_IDLE as 1 in FreeRTOSConfig.h

     

    Anyway to wakeup from tickless idle mode when there is BLE activities detected?

    This is done automatically for you, as tickless idle uses __WFE sleep, any activity will implicitly wake the chip and after processing is, the tickless mode will make the chip go to sleep again.

    You might like reading this page. 

  • Thanks ,

    Another question, during tickless idle mode. Have you guys seen any good example to overcome RTC clock drifting issue during Tickless IDLE on/off? We plan to have a external RTC driven World Clock for logging purpose.

  • the accuracy of the timers are as good as the accuracy of the RTC used underneath. so no other special mechanism is implemented in FreeRTOS port to address the RTC clock drifting. 

    The softdevice on the other hand does LFCLK calibration if internal RC is used for RTC clock.

    inghowe83 said:
    We plan to have a external RTC driven World Clock for logging purpose.

    I am not sure why you would need an external RTC for maintaining clock. Your external RTC would also be almost the same as the RTC in our device as they will be driven by the same clocks. It is the clock that contributes to the drift and not the RTC itself. 

  • Sorry, my error. I was referring to RTC which is driven by external crytstal XTAL. Maybe I should rephasemy question. Is there any timer which is running during FreeRTOS Tickless IDLE period which I could use as reference for the world clock in my embedded application?

  • inghowe83 said:
    Is there any timer which is running during FreeRTOS Tickless IDLE period which I could use as reference for the world clock in my embedded application?

    There is RTC1 running which is being used by FreeRTOS kernel to keep the RTOS tick count.

    I do not think you need to access this RTC1. You can get the ticks from the kernel by using xTaskGetTickCount..

     

    Susheel Nuguru said:
    which is running during FreeRTOS Tickless IDLE

    During the IDLE period the system is in sleep mode, but the RTC1 is still running (will not wake the system up on every tick though). When the system wakes up from tickless idle sleep, then a correction is made to the internal RTOS tick based on how long the system slept in tickles idle and this calculation will be based on RTC1 

Related