FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [March 2016 Threads]
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();
}
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.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.