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

Questions about portSUPPRESS_TICKS_AND_SLEEP()

Posted by kyle-shneider on January 23, 2017

It is written in the docs

The value of portSUPPRESSTICKSAND_SLEEP()'s single parameter equals the total number of tick periods before a task is due to be moved into the Ready state. The parameter value is therefore the time the microcontroller can safely remain in a deep sleep state, with the tick interrupt stopped (suppressed).

So, how is user able to control this parameter? I'm working in IAR IDE with stm32l151 chip and using default implementation of portSUPPRESSTICKSANDSLEEP. I set blinking of a led in Idle task (at every entrance turn on/off) and led blinking was pretty recognizable for a human eye. I've tried to always pass to portSUPPRESSTICKSANDSLEEP 2000, 200, 20, 2 ticks (in my project 1 tick = 1 ms) from prvGetExpectedIdleTime but after that led stays active all the way. Sorry for the noob question but in the docs it's just far from obvious.


Questions about portSUPPRESS_TICKS_AND_SLEEP()

Posted by rtel on January 23, 2017

Sorry, I don't follow what it is you are trying to do. portSUPPRESSTICKSAND_SLEEP() is called by the kernel, and the time passed into the function is calculated internally - it is not something you set manually.


Questions about portSUPPRESS_TICKS_AND_SLEEP()

Posted by kyle-shneider on January 23, 2017

Thanks for the answer. But how can i control the time for microcontroller sleep mode using default IAR portSUPPRESSTICKSAND_SLEEP implementation?


Questions about portSUPPRESS_TICKS_AND_SLEEP()

Posted by rtel on January 23, 2017

The time the system will sleep is set to be the next time the scheduler knows a task needs to execute. If this is too short then sleep is not entered at all (you can set the low limit time).

For example (assuming you have configUSETICKLESSIDLE set to 1), if all tasks are in the Blocked state, two are blocked indefinitely, one will time out in 50 ticks, and one will time out in 20 ticks, then portSUPPRESSTICKSAND_SLEEP() will be called (internally, by the RTOS) with the expected idle time set to 20 as that is the time the scheduler knows a task next needs to execute.


[ 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