Quality RTOS & Embedded Software

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


Timer callbacks

Posted by Paul Coleman on March 12, 2012
If I give a semaphore from within a software timer callback do I need to use xSemaphoreGiveFromISR() version?

Thanks, Paul.

RE: Timer callbacks

Posted by Richard on March 12, 2012
No. Timer callbacks run in the context of a task, so the non ISR version can be used. If the function is being called from a timer callback then the block time must be set to 0.


RE: Timer callbacks

Posted by Paul Coleman on March 12, 2012
I'm not sure which function you're referring to and xSemaphoreGive doesn't have a block time?

Thanks, Paul.

RE: Timer callbacks

Posted by Richard Damon on March 12, 2012
I think Richard was just making a general comment so that if, for example, a timer function wanted to put or get data from a queue that it should use a zero block time.

I would use the word should rather than must here, as unlike in the idle hook, where blocking will likely cause a kernel crash (as suddenly NO task is ready to run), a block in a timer function doesn't cause this level of problem, the user just needs to realize that if one timer function blocks, it block the whole timer task, so no other timer functions will run, nor will the program be able to process any new timer requests (they can be queued up in the timer queue until full, but the timer task won't be removing them). There may be special conditions where this is acceptable.

RE: Timer callbacks

Posted by Paul Coleman on March 12, 2012
Okay I see, thanks for the clarification :o)

[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Version 10.1.1 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