Skip to content

ESP32-S3 USB CDC doesn't work on every computer, "serial port is closed" errors #9580

Closed
@marcocipriani01

Description

@marcocipriani01

Board

ESP32-S3-WROOM-1U

Device Description

Self-powered ESP32-S3-WROOM-1U custom board with USB connected on pins IO19 and IO20. The power comes from a barrel jack and a 3.3V LDO regulator.
There is a USB Type-C connector and a TVS diode array (designed for USB 2.0 usage). VUSB doesn't go anywhere except for the TVS diode.

Hardware Configuration

image
image
image

Version

v2.0.15

IDE Name

Arduino IDE

Operating System

Windows 10, 11

Flash frequency

QIO 80MHz

PSRAM enabled

no

Upload speed

921600, upload via native USB

Arduino settings

Just USB CDC on boot:

image

Description

In my company, we developed a product based on the ESP32-S3-WROOM-1U that uses USB CDC on a Type-C connector to communicate with the computer. During prototyping we didn't have major issues with USB, but now we're testing the first production batch of boards on a large sample of computers and in various conditions. Unfortunately, about ¼ of the PCs in our production test have trouble connecting to the ESP32-S3, and the issue is unclear to us. These are some of the behaviors we observed:

  • On a few PCs, complete inability to connect to the serial port: every software we use to connect to the ESP32 says either "the serial port is closed" or simply "failed to connect". This includes the Arduino Serial Monitor, Visual Studio Code's Serial Monitor extension, our custom C# software and more.
    • No other info is provided by these software, and we're unable to debug the situation since we can't even connect once.
    • Putting the board in bootloader mode using GPIO0 correctly enters bootloader and these same PCs can successfully upload new sketches to the ESP32 using Arduino IDE.
  • On other PCs, including my workstation, the issue only happens sporadically (probably ⅓ of the times). The rest of the times, everything works fine. Downgrading to the old arduino-esp32 core 2.0.12 seems to decrease the frequency of the issue on the affected PCs, but doesn't solve it.
  • The rest of computers have absolutely no trouble connecting to the ESP32-S3 board under any circumstance. We can use our custom C# software to do all the things we need and USB never stops working,

While testing, I also discovered that opening and closing the serial monitor rapidly a few times (open-close-open-close-...) makes the USB CDC stop working. For example, I created a sketch that prints "Hello" and does one Serial.read() every second in the loop() function. After opening and closing the serial port a few times, I no longer see "Hello", I receive nothing.

The issues happens on all the 30 boards in our first production batch. They've been professionally reflow soldered by another company. I manually inspected all of them under a microscope for soldering defects around the USB Type-C connector and the ESP32 module. It is a 6 layer board and the USB differential pair is length-matched and impedance-controlled to 90Ω according to USB standard.

Sketch

Any Arduino sketch that uses Serial.print(), Serial.println(), Serial.read().

Debug Message

"The serial port is closed" on some software.

Other Steps to Reproduce

Unclear. Depends on the PC where testing.

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

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions