# low power mode transition with freeRTOS

**URL:** <https://forums.freertos.org/t/low-power-mode-transition-with-freertos/5032>\
**Category:** Kernel\
**Created:** [October 28, 2011, 8:04pm UTC](https://forums.freertos.org/t/low-power-mode-transition-with-freertos/5032 "2011-10-28T20:04:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [October 28, 2011, 8:04pm UTC](https://forums.freertos.org/t/low-power-mode-transition-with-freertos/5032/1 "2011-10-28T20:04:41Z")

</div>

**[paha11](https://sourceforge.net/u/paha11/)** wrote on [Friday, October 28, 2011](https://sourceforge.net/p/freertos/discussion/382005/thread/ddec48d5/#6b0d):

Hello  
I work with STM32 CortexM3 and I want to go to low power mode (sleep mode) My idea is as follows:  
1) Stop all peripherals except those that I want to be woke up from.  
2) call vTaskSuspendAll()  
3) call WFI that stops the core  
4) after wakeup, check the wakeup reason  
5) and call vTaskResumeAll()  
6) Now the OS is running as normal and I proceed with peripheral initialization  
I wonder if the described steps are sufficient and if I didn’t miss something important on the OS site.

Thank you very much for any reply

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [October 29, 2011, 11:33am UTC](https://forums.freertos.org/t/low-power-mode-transition-with-freertos/5032/2 "2011-10-29T11:33:02Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Saturday, October 29, 2011](https://sourceforge.net/p/freertos/discussion/382005/thread/ddec48d5/#4443):

It really depends on what you want the kernel to be doing while you are in sleep mode.

To keep track of time, and therefore to unblock tasks at the right time, you need to keep the tick interrupt running (see the exception below, about a tickless version of FreeRTOS).&nbsp; That means the tick interrupt will periodically bring the Cortex-M3 out of sleep mode, which can limit the power saving.&nbsp; There are ticks you can do, like reducing the tick frequency by a factor (say 10 for example) then calling the increment tick function 10 times each time the tick brings the CPU out of sleep.

For real power saving, there is a tickless version of FreeRTOS that removes the need for FreeRTOS to periodically wake the CPU up.&nbsp; It requires an external low power crystal (like a watch crystal) to allow even the timers to be turned off.&nbsp; I have provided a link below, which also contains a thesis on the subject.

[http://interactive.freertos.org/entries/20291196-energy-optimized-port-of-freertos-6-for-efm32](http://interactive.freertos.org/entries/20291196-energy-optimized-port-of-freertos-6-for-efm32)

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [October 31, 2011, 7:40am UTC](https://forums.freertos.org/t/low-power-mode-transition-with-freertos/5032/3 "2011-10-31T07:40:10Z")

</div>

**[paha11](https://sourceforge.net/u/paha11/)** wrote on [Monday, October 31, 2011](https://sourceforge.net/p/freertos/discussion/382005/thread/ddec48d5/#0519):

Richard,  
thank you for detailed answer

regars
