Unable to use RX and TX pin as INPUT after UART2 using

vishal.borle
Posts: 13
Joined: Thu May 07, 2020 1:32 pm

Unable to use RX and TX pin as INPUT after UART2 using

Postby vishal.borle » Tue Aug 24, 2021 4:32 am

Hello to all,

We are not able to use RX and TX pin as INPUT after when we used UART2 means Serial2 begin.
In brief my program code flow as below:

Code: Select all

 
 #define RX2_PIN         25
#define TX2_PIN          26
Serial2.begin(MODBUS_BAUDRATE, SERIAL_8N1, RX2_PIN, TX2_PIN);
// read data from Serial2
// once completed
Serial2.flush();
Serial2.end();
pinMode(RX2_PIN, INPUT);
pinMode(TX2_PIN, INPUT);
When we again call Serial2.begin(MODBUS_BAUDRATE, SERIAL_8N1, RX2_PIN, TX2_PIN); to read data from Serial2 then
hardware get restart Guru Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1)

Any help and sugestion it would be most appreciate...!!!!

STROMI
Posts: 1
Joined: Tue Sep 07, 2021 12:34 pm

Re: Unable to use RX and TX pin as INPUT after UART2 using

Postby STROMI » Tue Sep 07, 2021 12:47 pm

Possibly because RS485 on Serial2 pins does not work on ESP32-WROVER.

Which board are you using?
Maybe your hardware does not have user access to the Serial2 pins?
UART2/Serial2 uses GPIO16 and GPIO17 which are reserved in ESP32-WROVER.
You may need to change to a ESP32-WROOM.

"Note
The pins GPIO16 and GPIO17 are available for use only on the boards with the modules ESP32-WROOM and ESP32-SOLO-1.
The boards with ESP32-WROVER modules have the pins reserved for internal use."

Source <https://docs.espressif.com/projects/esp ... escription>

vishal.borle
Posts: 13
Joined: Thu May 07, 2020 1:32 pm

Re: Unable to use RX and TX pin as INPUT after UART2 using

Postby vishal.borle » Wed Sep 08, 2021 3:33 am

Thanks for your response....

We have fixed this problem by adding one line code after Serial2.end();

gpio_matrix_out(TX2_PIN, SIG_GPIO_OUT_IDX, false, false); // Workaround for use RX and TX pin as input after disabled Serial2

Now it working..

Who is online

Users browsing this forum: No registered users and 27 guests