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)? 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 Susheel Nuguru,
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
Susheel Nuguru Thanks. I notice there is a similiar request (outdated) as per the link below.
I want to keep track of the time using internal RTC and want to sync the time from a external device, such as a phone.
And the most important part is...is there any sample code available? Thanks
Susheel Nuguru Thanks. I notice there is a similiar request (outdated) as per the link below.
I want to keep track of the time using internal RTC and want to sync the time from a external device, such as a phone.
And the most important part is...is there any sample code available? Thanks
Please take a look at the example provided in the SDK to get the current time from the peer device (if it implements the BLE CTS profile).
Thanks for the BLE CTS profile, do you know what are the best method to obtain tick offset when wakeup from tickless idle mode? If my device doesn't connect to BLE for long period of time, my time offset when wakeup from tickless idle mode and the logging data time stamp will have huge offset on it.
Please advice.
before the system goes to sleep and as soon as your device wakes up you can call xTaskGetTickCount() and you can do a diff and add the difference to the timestamp you are maintaining.
thanks!