USB Disconnects When Going into Deep Sleep
ESP32-S2 and ESP32-S3 Boards
On Unexpected Maker ESP32-S2 and ESP32-S3 boards, USB disconnection during deep sleep is expected behavior. Native USB runs on the main cores, like regular code does, so when you put your board into deep sleep, the cores are shut down, and therefore USB can't run.
When the board wakes from deep sleep, USB restarts and re-enumerates.
Important: USB won't activate until after code loads and runs. You should add approximately one second of delay before the first serial print statement to ensure USB has started.
Traditional ESP32 Boards (e.g. TinyPICO)
On traditional ESP32 boards like the TinyPICO, the USB port remains physically active during deep sleep since a separate SerialUART chip controls it. However, with the ESP32 sleeping, the chip cannot communicate with the ESP32, so the connection is effectively down despite the port staying alive.
CircuitPython Clarification
In CircuitPython, with the USB connected, it actually doesn't go into deep sleep at all -- it fakes it, so you don't lose the drive! This is a simulation of deep sleep rather than actual deep sleep.
Last Updated: August 10, 2023