ESP32-S3-WROOM-1-N8 configuration assistance needed regarding serial monitor

I built a custom board using the ESP32-S3-WROOM-1-N8 chip.
Single USB-C connector wired to pins 19 (USB_D-) and 20 (USB_D+).

I am able to upload programs without having to press any buttons. Serial monitor starts displaying messages. But if I press the reset button, serial communication is interrupted and the terminal does not reconnect automatically, making me restart the serial monitor.

This does not happen in Arduino IDE, where I have the next configuration:

Board: ESP32S3 Dev Module 
Upload mode = UART0/Hardware CDC
USB mode =  (Hardware CDC and JTAG) or (USB-OTG). Both work
USB CDC on Boot = Enabled

I’m using VSCode + PlatformIO with the following platformio.ini config:

[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
monitor_speed = 250000
build_flags =
'-D ARDUINO_USB_CDC_ON_BOOT=1'

Why is the serial monitor not able to reconnect after rebooting the board?
I just checked out of curiosity with a different device, a real FireBeetle 2 ESP32-E board, and the serial monitor does reconnect automatically…

Just one more question, what’s the difference between using Hardware CDC vs USB-OTG (TinyUSB) with regards to upload and USB modes?

Thanks in advance

The native USB interface is used.
A native USB connection is always interrupted when the ESP32-S3 is reset.

I have tested this with the ArduinoIDE.

If the ESP32-S3 is connected and is restarted by pressing the reset button, the ArduinoIDE also lose the serial connection.

Because the connection was interrupted ( caused by the restart of the ESP32-S3).

The FireBeetle 2 ESP32-E does not have native USB. An external USB to UART chip is used here. This external chip is not restarted when the ESP32 is reset and therefore does not lose the connection.

A comparable situation would be to disconnect the cable between the PC and the FireBeetle and reconnect it. The serial connection would also be lost here.

Hello, thanks for your support.

You’re missing the point. Of course it loses the serial connection upon resetting the board. But serial monitor in PlatformIO does not reconnect automatically. After pressing any keyboard key, the serial monitor does reconnect, showing the next messages:

Disconnected (ClearCommError failed (PermissionError(13, 'The device does not recognize the command.', None, 22)))
Reconnecting to COM7    Connected!

As I said, reconnection is done automatically with no user interaction in Arduino IDE.

Windows 11 PC.

edit:

According to this post by @maxgerhardt, PlatformIO’s serial monitor is missing the autoreconnection feature…

Referring to the documentation, the monitor is based on Miniterm / pySerial and does not include any other features. I therefore believe that an automatic reconnection will not be possible.