I think it is still not clear to the team what you want to accomplish.
I am looking for way how to update time after MCU is woken from deep sleep.
And you also wrote:
but I don’t want to use tickless idle as I don’t want to go to sleep in the idle.
That sounds contradictory. OR do you insist on going to sleep from a user task? And if so, for what reason would you want that?
I do not use tickless idle mode as I don’t want scheduler to call sleep mode but it is called by program.
Could there be a misunderstanding here? When you use tickless mode, the scheduler will never invoke a sleep mode. You are supposed to provide the code that brings your CPU into a (deep) sleep.
The scheduler will tell you when
you must wake-up, because the scheduler knows when the first (internal) timer will expire. Another reason to wake-up, of course, can be a hardware interrupt that may not be ignored.
In tickless mode, you are to provide this function:
if configUSETICKLESSIDLE == 1
void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime )
/* Sleep at most 'xExpectedIdleTime' ticks. */
ulCompleteTickPeriods = vDeepSleep( xExpectedIdleTime );
vTaskStepTick( ulCompleteTickPeriods );
In fact, it doesn’t matter what you do in this function, as long as it does not last too long ( too short is no problem ), and as long as you keep the tick-counter up-to-date.
If you do not want to sleep from the idle task, and in stead you want to sleep from an application task, can you explain what would be the advantage?