-
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
Changing UART Baud rate messes up UART #476
Comments
@me-no-dev I now have a simple loopback testcase on Serial2 that shows this issue, as you will see if you run this, the data sent over the serial is totally corrupted after a change of baud rate
after changing the baud rate, its totally garbled
|
Update: |
I have a solution / workaround.
and in the library added the function uartChangeBaudRate()
I can now change my baud rate on the fly. |
@eroom1966 I would like to thank you for this, I can confirm it works great. |
has been fixed in master ;) |
@me-no-dev E |
I hope all issue will be fixed once I change the driver with the IDF one. |
hi @me-no-dev, any timeline for this driver change? as mentioned in the issue referenced above, this seems related to another issue and using IDF's driver will likely solve the issue (or help reject frame errors more easily) |
I am very concerned by this bug. Please keep me informed for a workarround. |
eroom1966's fix worked for me as well, why isn't it (re)implemented in master, yet ? |
/bump |
I'm going to create a pull request for something similar to eroom's, as this is still an issue. I can't change from 9600 to 921600 or 2M by simply Serial.End(), then Serial.Begin(XXXXX) |
This should resolve issue espressif#476
This should resolve issue espressif#476
Hello,
I think I have a similar issue to #441
If I configure UART2 to run at 57600 baud, I can send data messages and all works well.
However, I need to be able to perform configuration of the end device at 9600 baud,
then flip both sides of the interface into 57600 - I cannot get this to work reliably.
I have a fixed message length of 24 bytes (at 57600 baud), but when I send messages, there is some strange buffering occuring, such that on the serial line, 21 bytes of the message(0) are sent, then there is a pause until the next message(1) is sent, then I have the missing 3 bytes from message(0), followed by the next 21 bytes if message(1) - and so on.
This only occurs IF the baud rate is changed from 9600 to 57600, if I start with a baud rate of 57600, the messages are transmitted as expected. so effectively what I have is the following
void setup() {
Serial2.begin(9600, SERIAL_8N1, gpioX, gpioY);
}
in the functional code, at some point the interface is reconfigured
Serial2.begin(57600, SERIAL_8N1, gpioX, gpioY);
I have tried with various combinations of
Serial2.end(); // causes the program to stop
and adding delays to no avail.
so can anybody provide a snippett of code to show how to reconfigure the BAUD rate of the interface, without introducing the buffering issue described above.
E.
The text was updated successfully, but these errors were encountered: