Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


DSM and Low power mode

Posted by yariv gal on July 1, 2009
I am trying to figure out is the FreeRTOS support DeepSleepMode or LowPower mode ? if no,Is there any way to hooke the OS to lowpower or sleep mode?
Any piece of code example will be appreciated.


RE: DSM and Low power mode

Posted by Samuel Tardieu on July 1, 2009
The way it is often done is by defining an idle task (executed when nothing else is ready to execute) which puts the processor in whatever sleep mode you want.

RE: DSM and Low power mode

Posted by Adam Turowski on July 1, 2009
The easy way to hook into idle task without having to modify FreeRTOS code is to use
void vApplicationIdleHook( void ) function to do the job putting processor in sleep mode. To use it you have to include

#define configUSE_IDLE_HOOK 1

in your FreeRTOSConfig.h file.

RE: DSM and Low power mode

Posted by yariv gal on July 1, 2009
Thanks for quick answer.
In that case when I call vApplicationIdleHook( void ) what makes the processors to wake up again?
I guess that in case of idle task, interrupt will wakeup the system.
Also is there any watchdog timer for each task ?


RE: DSM and Low power mode

Posted by Adam Turowski on July 2, 2009
Almost all CPUs are woken up from sleep mode by interrupt. So the same applies to FreeRTOS.

When CPU will be woken up by interrupt, interrupt service routine will wake up any task waiting for data provided by this ISR. CPU will be active until all pending tasks will be executed and then idle task will be executed. This in turn will call vApplicationIdleHook( void ) putting CPU back into sleep mode.

Please note that FreeRTOS uses tick timer interrupt to run preemptive scheduler. This interrupt occurs (usually) every 1ms. So CPU will be woken up every 1ms, any pending task will be executed and then idle task will be called to put CPU back to sleep.

Regarding watchdog timer question there is no such timer for each task. You have to implement it yourself if you really need it.

Hope that helps,

[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

Version 10.1.0 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers


STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner