uart receive doubt?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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.
- Labels:
-
STM32F2 Series
-
UART-USART
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-05 2:41 AM
i read the buffer count ,using one flag then the count reached that buffer's high value then reset the count
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-04 1:06 AM
Submit a new request? Clear any pending errors? Move data from active buffer into a queue?​
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-05 2:35 AM
thank you @Community member​
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-05 2:38 AM
i am not using RTOS
Thankyou @Community member​
now working fine
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-01-05 2:41 AM
i read the buffer count ,using one flag then the count reached that buffer's high value then reset the count
