I am evaluating a few ESP boards and the ESP32-S3-DevKitC-1 has an issue with UART0 (I selected board: ESP32S3 Dev Module).
When I run the simple attached code, Serial1 works and I can see the text in putty on COM6. However, I am not seeing the text for Serial0 in the Arduino Serial Monitor Window. If I connect to the U0TXD pin I can see the output for Serial0 in putty. Why is the default Serial0 not showing in the serial monitor?
void setup() {
Serial.begin( 9600 );
//Serial1.begin ( 9600, SERIAL_8N1, 7, 8 ); // rx, tx
Serial1.begin ( 9600, SERIAL_8N1, 5, 4 );
delay(2000);
Serial1.println("**** PRINTING TO COM6 ****");
Serial.println(">>>---- PRINTING TO COM15 ----");
}
void loop() {
// put your main code here, to run repeatedly:
}
I have run the following code on a ESP32-S3 DevkitC-1 using Serial1
// ESP32-S3 DevkitC-1 Serial1 test - for loopback test connect pin GPIO17 U1TXD to pin GPIO18 U1RXD"
// ss https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/_images/ESP32-S3_DevKitC-1_pinlayout_v1.1.jpg
#define RXD1 18
#define TXD1 17
void setup() {
// initialize both serial ports:
Serial.begin(115200);
Serial1.begin(9600, SERIAL_8N1, RXD1, TXD1);
Serial.println();
Serial.println("\n\nESP32-S3 DevkitC-1 serial1 test pin GPIO17 U1TXD pin GPIO18 U1RXD");
Serial.write(" for loopback test connect pin GPIO17 U1TXD to pin GPIO18 U1RXD\n");
}
void loop() {
// read from port 1, send to port 0:
if (Serial1.available()) {
int inByte = Serial1.read();
Serial.write(inByte);
}
// read from port 0, send to port 1:
if (Serial.available()) {
int inByte = Serial.read();
//Serial.write(inByte);
Serial1.write(inByte);
}
}
connected to a HC-06 serial monitor displays
10:49:21.756 -> ESP32-S3 DevkitC-1 serial1 test pin GPIO17 U1TXD pin GPIO18 U1RXD
10:49:21.756 -> for loopback test connect pin GPIO17 U1TXD to pin GPIO18 U1RXD
10:49:21.756 -> hello esp32hc06 test 2
Yes this is odd. Serial1 works. Serial works if I connect to the U0TXD pin, but not in the Arduino serial window. That bugs me.
BTW the USB cable is plugged into the UART USB connector.
This is what my screen shows:
OK. This is weird.
I changed the baud rate from 9600 to 115200 on Serial0 like this Serial.begin( 115200 );
And it worked.
This DevKit must have a hard coded baud rate of 115200. If I change it to 9600 I get junk characters.
Also note it only works with USB CDC on boot "disabled".
I was going to tell you to try that..
last pic just looks like baud is wrong, even though i can see it's not..
weird..
better to use a faster baud for debugging anyways..