cancel
Showing results for 
Search instead for 
Did you mean: 

uart receive doubt?

LOGU
Associate II

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????

1 ACCEPTED SOLUTION

Accepted Solutions
LOGU
Associate II

i read the buffer count ,using one flag then the count reached that buffer's high value then reset the count

View solution in original post

5 REPLIES 5

Submit a new request? Clear any pending errors? Move data from active buffer into a queue?​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Jack Peacock_2
Senior III

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

thank you @Community member​ 

i am not using RTOS

Thankyou @Community member​ 

now working fine

LOGU
Associate II

i read the buffer count ,using one flag then the count reached that buffer's high value then reset the count