Skip to content

ESP32-S3 UART Issue on IO19 & IO20 – Data Corruption #11283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
mightChamp opened this issue Apr 23, 2025 · 5 comments
Open
1 task done

ESP32-S3 UART Issue on IO19 & IO20 – Data Corruption #11283

mightChamp opened this issue Apr 23, 2025 · 5 comments
Assignees
Labels
Chip: ESP32-S3 Issue is related to support of ESP32-S3 Chip Resolution: Unable to reproduce With given information issue is unable to reproduce Status: Needs investigation We need to do some research before taking next steps on this issue

Comments

@mightChamp
Copy link

Board

ESP32-S3

Device Description

esp32-s3 wroom 1 Module

Hardware Configuration

IO19 and IO20 as Uart RX and TX respectively

Version

v3.2.0

IDE Name

Arduino IDE

Operating System

Windows 11

Flash frequency

40Mhz

PSRAM enabled

no

Upload speed

921600

Description

We are attempting to use IO19 and IO20 as UART pins (115200 baud rate) but are encountering unexpected issues. While UART communication works flawlessly on IO17 and IO18 with no data corruption, switching to IO19 and IO20 results in byte corruption.

please clarify the following:

  1. Can GPIO19 and GPIO20 (USB pins) be reliably used for UART communication, as well as for general input and output?

  2. Are there any specific software configurations or additional code modifications required to enable proper UART functionality on these pins?

Sketch

void setup(){
Serial.begin(115200);
Serial1.begin(115200,SERIAL_8N1,19,20);
}

void loop(){
while(Serial.available())Serial1.write(Serial.read());
while(Serial1.available())Serial.write(Serial1.read());
}

Debug Message

Not useful logs, as corrupted data bytes only.

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@mightChamp mightChamp added the Status: Awaiting triage Issue is waiting for triage label Apr 23, 2025
@SuGlider SuGlider self-assigned this Apr 23, 2025
@SuGlider
Copy link
Collaborator

@mightChamp - Does it enable USB CDC when buiding the test example?

@mightChamp
Copy link
Author

No, I didn't Enable USB CDC when building the test example.

@smartes
Copy link

smartes commented Apr 24, 2025

Have you tried gpio_dump_io_configuration()

Below is an example of how to dump the configuration of GPIO4, GPIO18, and GPIO26:
gpio_dump_io_configuration(stdout, (1ULL << 4) | (1ULL << 18) | (1ULL << 26));

And later on the page
Configure USB PHY Pins to GPIO

gpio_config_t usb_phy_conf = {
    .pin_bit_mask = (1ULL << USB_PHY_DP_PIN) | (1ULL << USB_PHY_DM_PIN),
    .mode = GPIO_MODE_INPUT_OUTPUT,
    .pull_up_en = 0,
    .pull_down_en = 0,
    .intr_type = GPIO_INTR_DISABLE,
};
gpio_config(&usb_phy_conf);

@SuGlider
Copy link
Collaborator

@mightChamp - some answers:

Can GPIO19 and GPIO20 (USB pins) be reliably used for UART communication, as well as for general input and output?

Yes, it can be used for any compatible purpose and peripheral.

Are there any specific software configurations or additional code modifications required to enable proper UART functionality on these pins?

No specific configuration.

I have tested it using a ESP32 S3 Devkit C-1 board using exatly the same sketch reported in this issue ticket and it seems to run fine. No data loss or data corruption. I used a CH340 USB-UART converter attached to pins 19 and 20 and I could send/receive data using Putty and the Arduino Serial Monitor.

Could you please provide some detailed explanation about how to reproduce this issue?
There may be some Python Script to run in the PC side in order to send data and check the integrity in the ESP32-S3 side (and/or vice-versa).

@SuGlider SuGlider added Chip: ESP32-S3 Issue is related to support of ESP32-S3 Chip Status: Needs investigation We need to do some research before taking next steps on this issue Resolution: Unable to reproduce With given information issue is unable to reproduce and removed Status: Awaiting triage Issue is waiting for triage labels Apr 24, 2025
@mightChamp
Copy link
Author

Sorry for the delayed response.

We are performing OTA updates via GSM, where the GSM module sends the binary file data over UART (Pins 19 and 20). The update library then writes this data to flash for the firmware upgrade.

Each time, we receive all data bytes; however, the MD5 checksum of the file does not match.

Interestingly, when we switch the UART pins to 17 and 18 and perform the same OTA process, the MD5 checksum always matches.

We have thoroughly checked the hardware and found no issues on that front.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chip: ESP32-S3 Issue is related to support of ESP32-S3 Chip Resolution: Unable to reproduce With given information issue is unable to reproduce Status: Needs investigation We need to do some research before taking next steps on this issue
Projects
None yet
Development

No branches or pull requests

3 participants