rtel wrote on Thursday, August 07, 2014:
In tickless mode the RTOS will configure a clock to generate an
interrupt at the time the scheduler knows a task next needs to run - for
example if a task has called vTaskDelay( 100 ) then the scheduler knows
that task needs to run 100 ticks after the function was called.
However there is a limit to how far in the future it is possible to
generate an interrupt. The limit depends on the number of bits the
clock used to generate the interrupt has, and the speed at which the
clock is running - basically how quickly the clock will overflow. If
you are using the default Cortex-M tickless implementation then the
clock will overflow very quickly because it uses the systick to generate
the tick and the SysTick runs at the system clock speed (normally) and
is limited to 24-bits. You can override the default behaviour to use
whichever clock you like though - and the the official SAM4L tickless
demo does exactly that to enable it to sleep for much much much longer
when the tick is turned off.
If you want to sleep indefinitely then you can use the
eTaskConfirmSleepModeStatus() function to know if this is possible. If
all the tasks are block with a portMAX_DELAY block time and software
timers are not being used then eTaskConfirmSleepModeStatus() will return
eNoTasksWaitingTimeout. I think the RX100 tickless demo does this so
you can look at the source code as a reference.
aware if you do that though that, unless you re-sync with an RTC when
you exit low power mode, the SAM3 device will loose track of time
relative to calendar time. That probably doesn’t matter if you are
sleeping indefinitely though.