-
Notifications
You must be signed in to change notification settings - Fork 7.6k
serial.begin(baudrate) resets the full configuration of serial #5026
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
Comments
The function has default parameters. So, if you don't set them, it will use the defaults. If you want to call begin again, you must supply those custom paramteres again. If you just want to change frequency, use updateBaudRate. |
I have read the header file, I know I can do everything. Nothing wrong with this implementation, but in this case, portability among cores seems not trivial. |
When calling Serial::begin() (on ESP32) you apparently need to give all parameters or else it may use default parameters (makes no sense!) Serial::end() may cause a hang or crash -> timing issue See crash/hang: - espressif/arduino-esp32#5047 - espressif/arduino-esp32#5004 - espressif/arduino-esp32@81b7c47 - espressif/arduino-esp32#5112 - espressif/arduino-esp32#5032 Switch back to default: - espressif/arduino-esp32#5026
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
Hi,
Looking at HardwareSerial.h:
This calls does not only set the baud rates, but it resets the full configuration to the default values (even rx and tx pins). Is it an intended behavior or is a bug?
I think that if I do not specify further parameters, these shouldn't be changed.
I tested this behavior on latest commit 371f382
The text was updated successfully, but these errors were encountered: