You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently started investigating using your library for a ESP32 based project I'm starting but could never get any of the UART based examples to work. After spending way more hours than I'd like to admit, I finally figured out why.
In November of 2023, the Arduino Espressif ESP32 boards package updated from 2.X to 3.0, and apparently the hardware UART code has changed as none of the examples run properly anymore. When I revert to version 2.0.17 of the boards library, they all work correctly.
All 3.0.0 version migration related issues are discussed here if you would like to look at them.
The UART specific migration issues are documented here
Thank you for all the work you have put into this library!
The text was updated successfully, but these errors were encountered:
I now understand the cause of this issue and have a simple workaround. I thought I'd add it here in case someone else runs into the same problem.
The underlying change that caused the issue was listed in the 3.0.0 version migration related issues here.
Default pins for some SoCs have been changed to avoid conflicts with other peripherals: * ESP32’s UART1 RX and TX pins are now GPIO26 and GPIO27, respectively; * ESP32’s UART2 RX and TX pins are now GPIO4 and GPIO25, respectively; * ESP32-S2’s UART1 RX and TX pins are now GPIO4 and GPIO5, respectively.
This means that GPIO pins for Serial and Serial2 have changed and as a result, they no longer match all the existing HW designs and all the example code, pinout diagrams and documentation out there on the internet are now wrong. It is an interesting choice that Espressif made but at least they made it fairly easy to work around.
The simplest solution is to set the pins used for Serial and Serial2 to be the pins that were used before this breaking change. This can done by explicitly setting the pins used to their old/default values when you initialize the serial port:
Serial2.begin(115200, SERIAL_8N1, 16, 17); // Initialize HW UART drivers with the legacy RX/TX pins of 16/17
In theory, if you are using a library that calls begin on your behalf you can also call setPins() to change back to the old default pins and the pin assignments should be preserved when the library calls begin - however, this has not worked for me in my testing.
Serial2.setPins(16, 17); // Initialize HW UART drivers with the legacy RX/TX pins of 16/17
I hope this can save someone else some frustration when they attempt to update their design to use the new Espressif libraries.
I recently started investigating using your library for a ESP32 based project I'm starting but could never get any of the UART based examples to work. After spending way more hours than I'd like to admit, I finally figured out why.
In November of 2023, the Arduino Espressif ESP32 boards package updated from 2.X to 3.0, and apparently the hardware UART code has changed as none of the examples run properly anymore. When I revert to version 2.0.17 of the boards library, they all work correctly.
All 3.0.0 version migration related issues are discussed here if you would like to look at them.
The UART specific migration issues are documented here
Thank you for all the work you have put into this library!
The text was updated successfully, but these errors were encountered: