Tickless Idle and timers question

denisdaviau wrote on Wednesday, May 14, 2014:

In my application, I need to run in two different modes. When the screen is active, I need to use timers for screen updates and such. Once that times out, I need to go into low power mode that is exited with the RTC or a touch interrupt (no active software timers). I plan on stopping all the timers before going to sleep and turning them back on after wakeup.

The tickless idle examples I saw have timers turned off. Is there a restriction on the use of tickless idle and software timers?

In my “playing” I noticed something strange with my bare bones project. With times turned on (configUSE_TIMERS = 1) but no timers created, I still get my current consumption down to where I need it. The strange thing is that after the first RTC wake up, vTaskDelay (associated with an LED on period) is 10 times as long as it was before going to sleep. With the timers turned off (configUSE_TIMERS = 0) this is not an issue.

Your help with this is greatly appreciated.


rtel wrote on Wednesday, May 14, 2014:

I think the only time software timers become a problem is when you want an indefinite tickless time.

If all the application’s tasks are blocked indefinitely (they are all waiting for events without a timeout) then the maximum tickless period you can achieve is dependent on how frequently the clock overflows. If your are only using a 16-bit clock then it might overflow frequently, so if your application allows, it could make sense to just turn the clock off completely, so the only thing that can wake the system up is an external event rather than a pre-programmed timer event. However, you cannot turn the clock off completely if you are using software timers - therefore software timer functionality and indefinite tickless period functionality are mutually exclusive.


denisdaviau wrote on Thursday, May 15, 2014:

I did get tickless idle to work with a software timer. It was a bit of a hack, with changes to port.c, task.c, timers.c and timers.h. The key is to stop timers when you want to go to “Stop” mode and start them back up again when the application is active.

If anyone is interested, I can post the code. (tell me how cause I am new to the Source Forge support portal.)

lantczak wrote on Tuesday, September 06, 2016:

@Denis can you confirm that tickless mode is not working correctly with software timers? I noticed strange behaviour of my system when tickless mode is used

rtel wrote on Tuesday, September 06, 2016:

You don’t say what your issue is, what version of FreeRTOS you are
using, and are replying to a very old thread. If you look through the
version history you will see some changes were made to better support
timers in tickless mode - which version are you using?