Quality RTOS & Embedded Software

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


Interrupt and Task Synchronization Issue when using Semaphore.

Posted by naveenkumarbece on March 17, 2016

Interrupt and Task Synchronization Issue when using Semaphore.

Scenario: I have one ISR and one FreeRTOS Task. The ISR copies the data into queue whenever the ISR occurs. and FreeRTOS Task copies the data whenever there are some data in the queue. It is synchronsied using Semahpores.

If the interrupt calls evvery 100/10 ms, everything fine. if the interrupt calls every 1ms/100m micro seconds, the FreeRTOS task is not reading anything from the FIFO and the buffer overflows at the ISR Side.

Since, the ISR takes the Semaphore always, it seems that the FreeRTOS is not copying the data and in the blocked or suspended mode.

Any idea how to handle this scenario? any other way other than Semaphore?

ISR { Semaphore takefrom ISR(); // Copies data into static queue Semaphore givefrom ISR();


FreeRTOS Task { Semaphore take(port_MaxDelay); // Receives data from the static queue Semaphore give(); }

Interrupt and Task Synchronization Issue when using Semaphore.

Posted by hs2sf on March 18, 2016

You should try to reduce the interrupt rate (e.g. add an ISR private buffer to collect some more date before putting it into the shared, sem.protected Q). I guess your system is just overloaded when using the higher interrupt rate ie. is busy with ISR processing and there is no chance for the task to get into running state.

[ 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