ESP32 Hardware serial issue.

abanik
Posts: 4
Joined: Tue Aug 11, 2020 7:45 am

ESP32 Hardware serial issue.

Postby abanik » Tue Dec 08, 2020 6:41 am

Hello,
In my project, I am using Serial1 of ESP32 for RS485 and Serial2 for GSM module serial. After obtaining data from Serial1, I use the Serial1.end() to clear the buffer. After this the GSM modules fails to responds[unable to get any response for AT commands sent]. On investing the uartBegin() in esp32-hal-uart.c , there is section after which commenting then both the serial works normally.
uartBegin_issue.txt
Function for uartBegin()
(1.94 KiB) Downloaded 366 times
I wish to know what exactly is that section doing and why is Serial2 getting affected due to if that section is not commented.
Any help will be appreciated.

mikemoy
Posts: 627
Joined: Fri Jan 12, 2018 9:10 pm

Re: ESP32 Hardware serial issue.

Postby mikemoy » Tue Dec 08, 2020 5:29 pm

Just curious why your using Serial1.end() ?
Disables serial communication, allowing the RX and TX pins to be used for general input and output. To re-enable serial communication, call Serial.begin().
https://www.arduino.cc/reference/en/lan ... erial/end/

Who is online

Users browsing this forum: Majestic-12 [Bot] and 276 guests