Quality RTOS & Embedded Software

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


low power tickless atmel SAM3

Posted by wlauer on August 6, 2014

Using the tickless mode I would like to go to deep sleep only when all tasks are blocked with a delay of portMAXDELAY. I would have expected the xExpectedIdleTime to equal portMAXDELAY in the call to vPortSuppressTicksAndSleep but it's not. It appears as if it was portMAXDELAY but is being decremented with time. I thought tasks blocking with portMAXDELAY were put on the suspended task list so their block time would not decrement.

I do have INCLUDEvTaskSuspend 1 and configUSETICKLESS_IDLE 1 defined.

low power tickless atmel SAM3

Posted by rtel on August 7, 2014

In tickless mode the RTOS will configure a clock to generate an interrupt at the time the scheduler knows a task next needs to run - for example if a task has called vTaskDelay( 100 ) then the scheduler knows that task needs to run 100 ticks after the function was called.

However there is a limit to how far in the future it is possible to generate an interrupt. The limit depends on the number of bits the clock used to generate the interrupt has, and the speed at which the clock is running - basically how quickly the clock will overflow. If you are using the default Cortex-M tickless implementation then the clock will overflow very quickly because it uses the systick to generate the tick and the SysTick runs at the system clock speed (normally) and is limited to 24-bits. You can override the default behaviour to use whichever clock you like though - and the the official SAM4L tickless demo does exactly that to enable it to sleep for much much much longer when the tick is turned off.


If you want to sleep indefinitely then you can use the eTaskConfirmSleepModeStatus() function to know if this is possible. If all the tasks are block with a portMAXDELAY block time and software timers are not being used then eTaskConfirmSleepModeStatus() will return eNoTasksWaitingTimeout. I think the RX100 tickless demo does this so you can look at the source code as a reference. http://www.freertos.org/RX100RSKLowPowerTick-lessRTOS_Demo.html Be aware if you do that though that, unless you re-sync with an RTC when you exit low power mode, the SAM3 device will loose track of time relative to calendar time. That probably doesn't matter if you are sleeping indefinitely though.

Regards, Richard.

[ 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