-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UART driver: large RX buffer may be ineffective (IDFGH-11220) #12386
Labels
Resolution: NA
Issue resolution is unavailable
Status: Done
Issue is done internally
Type: Bug
bugs in IDF
Comments
github-actions
bot
changed the title
UART driver: large RX buffer may be ineffective
UART driver: large RX buffer may be ineffective (IDFGH-11220)
Oct 11, 2023
espressif-bot
added
Status: Selected for Development
Issue is selected for development
and removed
Status: Opened
Issue is new
labels
Nov 12, 2023
espressif-bot
added
Status: Reviewing
Issue is being reviewed
Status: Done
Issue is done internally
Resolution: NA
Issue resolution is unavailable
and removed
Status: Selected for Development
Issue is selected for development
Status: Reviewing
Issue is being reviewed
labels
Nov 21, 2023
movsb
pushed a commit
to movsb/esp-idf
that referenced
this issue
Dec 1, 2023
Ringbuffer usage becomes more efficient with the use of xRingbufferReceiveUpTo Closes espressif#12386
espressif-bot
pushed a commit
that referenced
this issue
Dec 8, 2023
Ringbuffer usage becomes more efficient with the use of xRingbufferReceiveUpTo Closes #12386
espressif-bot
pushed a commit
that referenced
this issue
Jan 3, 2024
Ringbuffer usage becomes more efficient with the use of xRingbufferReceiveUpTo Closes #12386
espressif-bot
pushed a commit
that referenced
this issue
Jan 4, 2024
Ringbuffer usage becomes more efficient with the use of xRingbufferReceiveUpTo Closes #12386
espressif-bot
pushed a commit
that referenced
this issue
Jan 5, 2024
Ringbuffer usage becomes more efficient with the use of xRingbufferReceiveUpTo Closes #12386
hathach
pushed a commit
to adafruit/esp-idf
that referenced
this issue
Mar 27, 2024
Ringbuffer usage becomes more efficient with the use of xRingbufferReceiveUpTo Closes espressif#12386
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Resolution: NA
Issue resolution is unavailable
Status: Done
Issue is done internally
Type: Bug
bugs in IDF
Answers checklist.
IDF version.
v5.1.1
Espressif SoC revision.
ESP32C3
Operating System used.
macOS
How did you build your project?
Command line with Make
If you are using Windows, please specify command line type.
None
Development Kit.
Custom design
Power Supply used.
USB
What is the expected behavior?
Using a large (in our case 180kB) RX buffer with the UART driver should cause no issues while read()ing is permanently running, say, 160kB "behind" the data being received.
What is the actual behavior?
After a while, the UART driver reports "RX Buffer Full", and then stops removing data from the UART's hardware FIFO, leading to reports of FIFO overflow.
The UART RX only resumes once the reader has read through the whole amount it is typically behind.
This is caused by the UART driver using xRingBufferReceive() on a byte ring buffer, which will give ownership of ALL the data currently in the ring buffer, or all the data up to the end of the storage area (if the data wraps), to the UART driver. The driver then parcels this data out a few bytes at a time in read() requests, but has no way of returning no-longer-needed data to the ring buffer until it has used ALL bytes for read()s.
When the reader is running considerably behind the UART RX, this can result in almost all of the RX buffer being owned by the UART, driver, and being held for an unreasonable amount of time.
Steps to reproduce.
Debug Logs.
More Information.
No response
The text was updated successfully, but these errors were encountered: