ESP32-S3 Can't get second UART to work - Help !

I have an ESP32-S3 board and I can not get a second serial UART to work. The main UART0 on USB is fine but when I define a second serial UART and specify the GPIO pins, it does not work.
The test code looks like this...

  #include "Arduino.h"
//---[ VARIABLE DEFINITIONS ]----------------------------
  int   x = 0;
  int   y = 0;
  int   i = 0;
  int loopcount = 0;
//---[ SETUP ]-------------------------------------------
void setup() {
    Serial.begin(115200);
    Serial1.begin(9600, SERIAL_8N1, 18, 17);  // Speed, Mode, Rx pin, Tx pin
    Serial2.begin(9600, SERIAL_8N1, 10, 11);  // Speed, Mode, Rx pin, Tx pin
    //Serial1.begin(9600,SERIAL_8N1,dcn_in_pin,dcn_out_pin);
    pinMode(17,OUTPUT);
    pinMode(18,INPUT);
    pinMode(11,OUTPUT);
    pinMode(10,INPUT);
    
    pinMode(7,OUTPUT);
}

//---[ MAIN PROGRAM LOOP ]--------------------------------
void loop() {
  loopcount++;
//----------------------------------
  Serial.println("--------------------------------------");
  Serial.println("Hello SERIAL from ESP32-S3  Pass " + String(loopcount));
  Serial1.println("Hello SERIAL1 from ESP32-S3  Pass " + String(loopcount)); 
  Serial2.println("Hello SERIAL2 from ESP32-S3  Pass " + String(loopcount)); 
  digitalWrite(7,HIGH);
  delay(1000);
//----------------------------------
  digitalWrite(7,LOW);
  delay(1000);
}

Has anyone gotten a second UART to work on the ESP32-S3?
Thanks
George

Check the migration document, I see it mentions UART. OR just roll back your ESP32 board file to 2.0.17.

Thanks for the suggestion. I don't know how to do the rollback. Do you mean use Arduino IDE rev 2.0.17 ?

NO the boards entry for esp32 by Espressif, see pic

Thanks ! I will give that a try.

Sadly, no joy. Thanks for the suggestion. I have to think someone out there has tried to use a second serial port on an ESP32-S3 with the Arduino IDE.
All suggestions are welcome.

Try this. Note that UART default pins may be used for other purposes.

There is some confusion on that web page about the number of UARTs in the S3.

Thanks. I read through that before I posted my problem.
I just finally figured it out. Actually a friend did. He said to try commenting out the pin direction definitions. That worked.
I am pretty sure I defined the UART input or output direction on other projects but in this case, eliminating the pinMode commands on the UART pins made it work.
Go figure !

1 Like

Nope, I doubt redefining the pin functions after calling Serialx.begin() ever worked.

It will reconfigure the internal Pin muxes and disconnect the UART.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.