-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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: fixes begin() after a previous begin() :: deleting previous RX/TX buffers and its data #9095
Conversation
👋 Hello SuGlider, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
[HardwareSerial]: Changes CI to match new HardwareSerial begin() and end()
[uart]: fixes end(void) instead of end(bool)
@me-no-dev | @lucasssvaz - It seems that HIL isn't working... CI is faling due to some Python failure. |
[fix]: adjust commentary of the copyright year
Description of Change
HardwareSerial::begin()
has a bug that by always restaring the IDF UART driver, the currently running UART driver will release all the RX and TX ringbuffers causing it to drop all data waiting to be read.This is very easy to verify by cross connecting RX/TX running
begin()
,write(byte)
and thenbegin()
+read()
. No data is read.The second issue is relatet to changing the RX Pin using
begin()
orsetPins()
.This causes a BREAK in the line and stops the driver, unless it is caught.
Both issues are corrected in this PR.
HardwareSerial::end(bool)
has been changed to the standardHardwareSerial::end()
Important note:
No data is lost when changing the Arduino standard parameters, such as baud rate, uart frame format and pins.
But if the user changes IDF driver internal settings, like Line Inverting, RX/TX buffer size or RX FIFO IRQ Threshold, the driver must be restarted and it will cause the RX/TX buffer to be released with its data.
Tests scenarios
Tested with ESP32-S3 using UART0, UART1 and UART3
Related links
#9020