2021-01-04 12:22 AM
i am using stm32f207ve microcontroller ,im receiving continuously data from another controller using 50 buffer using interrupt, after the 50 buffer is filled then again the data not receive in buffer 0 ,what i do now????
Solved! Go to Solution.
2021-01-05 02:41 AM
i read the buffer count ,using one flag then the count reached that buffer's high value then reset the count
2021-01-04 01:06 AM
Submit a new request? Clear any pending errors? Move data from active buffer into a queue?
2021-01-04 10:44 PM
You need a way to synchronize processing incoming data with the arrival rate. If data arrives at a faster rate than your application can process then you need to discard excess data until you have space freed up in your buffer.
If you use an RTOS then write the incoming data to a queue or streaming buffer rather than a small fixed buffer. Send a signal with a semaphore to the processing task when the minimum amount of data is available. The completion task removes the data from the queue or buffer, allowing you to collect more incoming data from the serial port.
If you don't have an RTOS the code is more complicated. You will need buffer management routines that implement a FIFO (first in-first out) type queue, along with a semaphore system to signal when data processing should occur.
You might want to look at FreRTOS, a real time operating system designed to handle this type of application. With an RTOS this is a very simple coding exercise. Without an RTOS you will need quite a bit more code.
Jack Peacock
2021-01-05 02:35 AM
thank you @Community member
2021-01-05 02:38 AM
i am not using RTOS
Thankyou @Community member
now working fine
2021-01-05 02:41 AM
i read the buffer count ,using one flag then the count reached that buffer's high value then reset the count