Interrupt and Task Synchronization Issue when using Semaphore.
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?
Semaphore takefrom ISR();
// Copies data into static queue
Semaphore givefrom ISR();
// Receives data from the static queue