Hi,
I have gone through no. of threads on this topic but somehow not able to clearly understand the difference of sleep mode implementation from Idle task hook and using tickless idle mode.
My current implementation is in idle task hook, as below:
void vApplicationIdleHook( void )
{
if(alltasksreadyforsleep()) //check if all other tasks set their flags indicating ready to sleep
{
stopTickTimer(); //stop freeRTOS tick timer
setRTCAlarm(); //30s RTC alarm interrupt for wakeup
sleep_MCU(); //make MCU sleep
disableRTCAlarm(); //disable RTC from giving any other interrupt
startTickTimer(); //start freeRTOS tick timer
resetalltaskreadyflags(); //set all task ready to sleep flags to false
}
}
In above implementation, my application hang-up during wakeup cycle randomly after functioning for few hours. I was reading about tickless idle mode and got into confusion if I am doing above things correct or I should use tickless idle mode and implement macro portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ).
Please suggest.
Thanks,
Pradeep