3.3.5: `while (!Serial)` no longer prevents first CDC print loss after flashing (ESP32-S3 USB CDC on boot)
Author: eMUQICreated Dec 24, 2025Updated Sep 30, 2026
LabelsStatus: In Progress ⚠️
Board
Waveshare ESP32-S3-Zero
Device Description
Waveshare ESP32-S3-Zero
Hardware Configuration
NO
Version
v3.3.5
Type
Bug
IDE Name
Arduino IDE 2.3.6
Operating System
Windows 11
Flash frequency
QIO 80MHz
PSRAM enabled
yes
Upload speed
921600
Description
On an ESP32-S3 board that uses native USB CDC (“USB CDC on boot”), I use while (!Serial) {} in setup() to wait for the serial port connection so the first Serial.println() won’t be lost.
This works as expected on arduino-esp32 v3.3.0, but on v3.3.5 the very first message printed right after uploading (the auto-run immediately after flashing) is often lost. If I press reset afterwards, the message appears normally.
Other versions have not been tested.
Sketch
void setup() {
// The code here runs once:
Serial.begin(9600); // Initialize serial communication and set the baud rate to 9600
while (!Serial){
; // Wait for serial port connection to be established
}
Serial.println("Hello World!");
}
void loop() {
// The code here repeats over and over again:
Serial.println("Hello ESP!");
delay(5000);
}Debug Message
NAOther 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.
Source: espressif/arduino-esp32