Quality RTOS & Embedded Software

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




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) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists