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

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 ]    [ 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