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

How to control fall into SLEEP mode

Posted by mrazoun on October 25, 2016

Hi, sorry for beginner's questions. How is it possible to control falling into SLEEP mode ?

When I'm using the peripheral (for example UART) which is not working in SLEEP mode I have to inform somehow FreeRTOS that the task need uP in RUN. Now I made it through proper setting of constant configEXPECTEDIDLETIMEBEFORESLEEP and parameter "xTicksToWait" in function ulTaskNotifyTake(). After that it depends on condition "if( xExpectedIdleTime >= configEXPECTEDIDLETIMEBEFORESLEEP )" (function portTASK_FUNCTION() in task.c) if uP goes into SLEEP or not. Is it possible only by this way ?

My setup : EFM32GG (Cortex-M3), FreeRTOSLowPowerTickManagementBURTC.c, FreeRTOS V8.2.3, SLEEP = EM2 Thank's in advance. Zdenek


How to control fall into SLEEP mode

Posted by rtel on October 25, 2016

In FreeRTOSLowPowerTickManagementBURTC.c you will see a function called vPortSuppressTicksAndSleep() which handles the entry into and out of sleep mode.

In that function you will see a call to SLEEP_Sleep() - which if I recall correctly is a call into the SiLabs library, and the library function should not put the MCU into a sleep mode that is too low for the peripherals being used. So the first question is, did you use the SiLabs library functions to initialise the UART? If so, why does the sleep manager not know that it cannot go into a sleep mode lower than the minimum the UART can use?

Just above there you will see a macro called configPRESLEEPPROCESSING() being called. That allows you to insert any code you want, and if the code the macro executes decides you should not go into sleep mode then set its parameter (xModifiableIdleTime) to zero and you will not go into sleep mode. Note this is a macro, not a function, so in the macro's implementation you have to access the xModifiableIdleTime variable directly.


How to control fall into SLEEP mode

Posted by mrazoun on October 26, 2016

Thank's for your very heplfull message. Now I understood this and I will modify my source code according to your explanation.


[ 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