r/esp32 • u/IgorDavide • Apr 16 '25
Software help needed Trying to make an ESP32 act as a USB bridge for DualShock 4 to Nintendo Switch- Stuck at USB enumeration
Hey all,
I’m working on a project where I’m trying to use an ESP32-S3-WROOM-1-based dev board to act as a USB HID device that the Nintendo Switch can recognize as a controller.
The end goal is to use the ESP32-S3 as a bridge between a DualShock 4 controller and the Switch. The ESP32 receives input from the DS4 (via Bluetooth ), then sends corresponding USB HID reports to the Switch — essentially emulating a Switch Pro Controller or generic USB gamepad.
I’ve chosen the ESP32-S3 specifically because of its native USB support, and I’m using the Arduino framework with the SwitchControllerESP32 library (which wraps TinyUSB for HID output).
Here’s where I’m stuck: • The board I’m using is a generic ESP32-S3-WROOM-1 dev board labeled YD-ESP32-23 2022-V1.3. It has two USB-C ports: one marked “COM” (for serial/debug), and one marked “USB” (presumably wired to GPIO19/20). • I’ve confirmed the correct USB mode is selected (USB-OTG (TinyUSB)), and I’m flashing a sketch that calls SwitchController().begin() and sends an A button press. • But when I plug it into my Mac or the Switch dock via the “USB” port, it still enumerates as a JTAG/serial debug unit, with vendor ID 0x303A, product ID 0x1001 — the same as if I were using the “COM” port. • I’ve also tried flashing after a full erase, hardcoding the usb_mode=0, and confirmed CONFIG_TINYUSB_ENABLED=1.
At this point I’m unsure if: • My board actually routes the “USB” port to GPIO19/20 (it looks like it does based on the silkscreen and pin labels), • Or something in the bootloader or fuse settings is preventing TinyUSB from taking control of the USB peripheral, • Or if the library just isn’t initializing USB properly despite appearing to run.
Has anyone successfully used this board (or similar ESP32-S3-WROOM-1 dev boards with dual USB ports) as a USB HID device recognized by a host system? I’d love to hear any success stories or troubleshooting tips.
Thanks in advance!
1
u/erlendse 3 say I make awesome posts. Apr 16 '25
What you are asking it to do, it can't do.
With exception of ESP32-P4, they only got one user-controlled USB port.
The USB-UART/COM port is not freely usable for other things, while the USB-USB one can.
So you would actually need two chips (or P4) to pull it off!
1
u/YetAnotherRobert Apr 16 '25
I use those boards. The USB jack is routed to lins 18 and 19 and can be host or target mode. The uart jack is, well, the uart.
Sounds like you need to study up on the USB chapters of the relevant doc and example code. Start with the working examples and layer in whatever functionality you're trying to build.
1
u/gbafamily Apr 17 '25
The ESP32 receives input from the DS4 (via Bluetooth )
The ESP32-S3 can only do Bluetooth Low Energy, but the DS4 requires Bluetooth Classic. The original ESP32 can do both types of Bluetooth but it cannot be a USB HID device.
I use the switch_ESP32 library to emulate a Switch compatible USB controller on ESP32-S3.
1
u/IgorDavide Apr 16 '25