Quality RTOS & Embedded Software

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




Loading

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.

http://www.freertos.org/AtmelSAM4L-EKLowPowerTick-lessRTOSDemo.html

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 ]    [ Sitemap ]    [ ]




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

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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