Low-power: There's no way you could "knock out the chip cold" without a lot of hassle right?

My platform: STM32WB55x device, 512K Flash, 512K Ram, 32Mhz main freq., M4F core.

Hi, I want to know if it is possible to, with minimal workload, completely disable system tick before putting the system to deep sleep (hence knocking it out ‘cold’, until… you woke it up with external interrupt of course)?

Based on what I read (I could be completely wrong), in FreeRTOS, a sleep/low-power mode simply puts the entire system to low-power mode for some time, wakes it up periodically to specifically allow system ticks related functionalities to run, with checking if there are tasks waiting to be run being one of the primary ones.

If no task needs to be run, the idle task will execute the hook function, which puts the system to low-power mode for another period, until once again having it waken up by the system tick interrupt, so on so forth ad infinitum.

So from a FreeRTOS point of view, the “sleep mode” is not really a “stone cold” sleep mode, but “wake me up, see if things need to be done, if not wake me up later” mode.

My questions are :

  1. Is my understanding of FreeRTOS’s sleep mode, described above, correct?

  2. If so, can I completely disable the system tick, completely take the “waking up periodically” out of the equation, without having to move heaven and earth (doing tons of code modification to the kernel code of my adaption for FreeRTOS)?

The kernel itself won’t care if the tick interrupt totally stops. As long as the application doesn’t need to worry about how log the system went to sleep (or your stop code provides that information itself from somewhere else) things will be fine.

So if you have a timer that tries to do something every 5 minutes, and you put the system to sleep for 9 minutes and stopped the clock, if that means that it is ok for that ‘5 minute’ task to have 14 minutes between operation, you are fine.

Thank you! That’s the kind of answer I was looking for.

Anything I should look out for were I to stop the system tick completely?

The biggest ‘risk’ is that you need to make sure that nothing really needs to know how much time has expired on needs to run at a certain time in the future.

Got it! Luckily my system doesn’t have those timer-dependent functions.