Skip to main content
LOGU
Associate II
Jan 4, 2021 8:22 AM UTC
Solved

uart receive doubt?

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

This topic has been closed for replies.
LOGU
LOGUBest answer
Associate II
Jan 5, 2021 10:41 AM UTC

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

5 replies

Tesla DeLorean
Guru
Jan 4, 2021 9:06 AM UTC

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
LOGU
LOGUAuthor
Associate II
Jan 5, 2021 10:35 AM UTC

thank you @Community member​ 

Jack Peacock_2
Associate II
Jan 5, 2021 6:44 AM UTC

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

LOGU
LOGUAuthor
Associate II
Jan 5, 2021 10:38 AM UTC

i am not using RTOS

Thankyou @Community member​ 

now working fine

LOGU
LOGUAuthorBest answer
Associate II
Jan 5, 2021 10:41 AM UTC

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