Same symptom as documented in this old, closed discussion:
During boot the device seems to hang indefinitely when calling Serial.begin() if you don't open a serial connection in one terminal or another. I have two LEDs wired up to the board on pins 43 and 44 for some debugging, and this simple code demonstrates the issue:
#define LED_GREEN 43
#define LED_YELLOW 44
void setup() {
pinMode(LED_YELLOW, OUTPUT);
pinMode(LED_GREEN, OUTPUT);
digitalWrite(LED_YELLOW, LOW);
digitalWrite(LED_GREEN, LOW);
digitalWrite(LED_YELLOW, HIGH);
Serial.begin(115200);
digitalWrite(LED_GREEN, HIGH);
// ...
}
After uploading the program, the device boots and the first LED comes on. The next LED remains off until I connect to the serial port with a terminal program, almost like it's hung waiting for some DTR or CTS signal or something.
Looked in the esp32 hardwareserial code in github but nothing stood out immediately and I'm not even sure if that's what the normal Serial library is using under the hood.