1. Home
  2. Boards
  3. No USB or USB connectivity issues with my ESP32-S2 or ESP32-S3 board

No USB or USB connectivity issues with my ESP32-S2 or ESP32-S3 board

Problem: USB Serial port does not appear after flashing your code?

CDC On Boot

If using Arduino IDE, have you enabled CDC On Boot in the tools menu? If not, USB won’t initialise when your code starts up.

In PlatformIO, you must have it enabled in build_flags or USB won’;’t initialise when your code starts up.

build_flags = 
   -D ARDUINO_USB_CDC_ON_BOOT=1

Code crashing?

UM ESP32-S2 and ESP32-S3 boards use native USB, which means the USB enumerates once your code is up and running and runs alongside your code.

If your code crashes or gets stuck in a tight loop, or causes a boot loop, USB will never get a chance to enumerate, or if it does enumerate, will disappear again.

NOTE: Even if your code is not using any USB functionality, The USB peripheral runs along side your user code on the main core, and if your code blocks execution (like when using delay() in Arduino) – The USB peripheral can stop functioning as it might get starved for core cycles.

Problem: USB is working, but it’s not stable?

Here’s a check list of things to go over if you are seeing stability issues with USB connection with an Unexpected Maker ESP32-S2 or ESP32-S3 board.

Make sure you are using a proper Data and Power USB-C cable.

Not all cables to data, and not all cables (especially long ones) are made well. Use a good quality cable.

Don’t use a USB Hub – Direct connect your boards to your computer USB port.

Not all powered hubs provide enough noise free current, and not all powered hubs actually deliver 5-5.1V required to run the boards.

Un-powered hubs are even worse as they draw their power from the host, and not all computer USB ports can deliver steady voltage and current going through a hub.

Try flipping your USB-C cable over.

USB-C cables can be inserted in either direction, and sometimes there might be dust or other foreign bodies in the connector that hinders one side from making good electrical contact, and flipping it over can improve it.

Updated on June 27, 2024

Related Articles