bryce78 wrote on Friday, March 10, 2017:
Hello Community!
I am wondering about the compatibility of software timers and low-power tickless idle modes to sleep indefinitely. I read in the version history that around v8.2.3 there were enhancements/fixes made **“to the software timer code that allows tickless low power applications to sleep indefinitely when software timers are used”. **
However, this does not appear to be working for me – the software timers still wake the RTOS, so I’m unsure I’ve configured things correctly. I did not find any examples in “FreeRTOS/Demo” directory that illustrate tickless idle and software timers in use.
In my case:
- FreeRTOS v9.0.0
- (configOVERRIDE_DEFAULT_TICK_CONFIGURATION == 1) and (configUSE_TICKLESS_IDLE == 2)
and I’ve defined the RTOS tick generated by RTC module at 128Hz. - I have 3 tasks and 2 software timers (running at 32Hz and 4Hz).
When my application has nothing to do the tasks enter the blocked state with portMAX_DELAY timeout and portSUPPRESS_TICKS_AND_SLEEP(xExpectedIdleTime) is called, where xExpectedIdleTime = 2.
(I have set configEXPECTED_IDLE_TIME_BEFORE_SLEEP == 2 so the RTOS will want to stop the ticks and enter sleep very quickly.)
With a short idle time – likely because of the software timers – the RTOS wakes after a short time, as one would expect. I can’t realize the functionality described in the FreeRTOS version history (bold section above); logically it doesn’t seem possible, but apparently it’s implemented?
Perhaps I misinterpret the comment or missunderstand how to configure the tickless idle to work in conjunction with software timers? I did try disabling/enabling the software timers in the portPRE_SLEEP_PROCESSING/portPOST_SLEEP_PROCESSING but that was a bad idea!
Perhaps the comment in the version history is incorrect? It seems to contradict
Software timers are not being used, so the scheduler is not due to execute a timer callback function at any time in the future. written here http://www.freertos.org/low-power-tickless-rtos.html
Could someone clarify?
Thanks!
Bryce