I’m new to using FreeRTOS and have been working on adding tickless idle mode on a project running on a Cortex M0 based PSoC to allow the use of deep sleep modes when systick is not running.
I think I have things mostly working, but have noticed an issue upon wakeup from deep sleep where it appears none of my tasks are serviced until 1 full tick AFTER I am awake and ready to start processing again. I am calling vTaskStepTick() with the appropriate number of ticks and the RTOS seems to be keeping track of time correctly, I just want to get rid of this wasted idle tick when I wake up.
Here is a screenshot of my signals: http://i.imgur.com/OK09p4w.png
I have a simple LED task and CapSense (touch sensing) task running on a 10 ms interval. The Deep Sleep channel is showing when the part is going into tickless idle mode and the CPU Sleep channel is when I’m only sleeping the CPU (which only occurs when the system is idling for less than the configEXPECTED_IDLE_TIME_BEFORE_SLEEP = 2 parameter).
As can be seen, when the Deep Sleep signal deasserts the system wakes up but the system appears to idle for 1 full tick (CPU Sleep) before my LED Task and CapSense task get to run. I’d like them to run immediately to increase my deep sleep time.
Any ideas why this is? Note the SysTick source is OFF during the tickless/DeepSleep mode, so there is no pending SysTick interrupt when I come out of deepsleep and finish vApplicationSleep. Was wondering if the RTOS is expecting this to be the case or if I should try to force a pending interrupt when coming out of deepsleep. Or is there something else going on here?
Thanks for any help.