adafruit / adafruit/Adafruit_TinyUSB_Arduino
USB protocol >= 2.1 on ESP32 fails to bring up USB stack on Windows (WebUSB example)
- Dominant language
- C
- Stars
- 654
- Forks
- 183
- PR merge metrics
- No merged PRs in 30d
Description
### Operating System
Windows 11
### Arduino IDE version
2.3.6
### Board
LilyGo T Dongle S3
### ArduinoCore version
3.3.0
### TinyUSB Library version
3.7.1
### Sketch as ATTACHED TXT
https://github.com/adafruit/Adafruit_TinyUSB_Arduino/blob/master/examples/WebUSB/webusb_serial/webusb_serial.ino
### Compiled Log as ATTACHED TXT
[logs.txt](https://github.com/user-attachments/files/21684926/logs.txt)
### What happened ?
I'm attempting to test the WinUSB example from the examples directory on an ESP32S3 device (T Dongle S3 from LilyGo). After compiling, flashing and re-plugging, the device does not enumerate correctly in Windows 11 23H2.
I've tried to do some debugging on this, here are some rambling comments:
* It seems related to USB 2.1 support, under 2.0 the device starts but there is no request to tud_descriptor_bos_cb
* I can only get tud_descriptor_bos_cb to be called if https://github.com/espressif/arduino-esp32/blob/7bfd45189d001d0d6fcca1922eda3648f41d386d/cores/esp32/esp32-hal-tinyusb.c#L401 is commented out which doesn't seem right
* I've tried older versions of the code and still get the same issue
### How to reproduce ?
1. Install latest Arduino IDE, latest ESP32 board and latest Arduino TinyUSB library
2. Take the example sketch and paste into new IDE window
3. Set USB CDC on boot to Enabled
4. Set USB DFU on boot to Disabled
5. Set USB Firmware MSC on boot to Disabled
6. Set USB mode to OTG (TinyUSB)
7. Flash firmware
8. Plug in
9. Device will fail to enumerate
### Debug Log
_No response_
### Screenshots
### I have checked existing issues, pr, discussion and documentation
- [x] I confirm I have checked existing issues, pr, discussion and documentation.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with examples/WebUSB/webusb_serial/webusb_serial.ino, the attached logs.txt, and the ESP32 esp32-hal-tinyusb.c code around line 401. Compare the USB 2.0 and 2.1 behavior around tud_descriptor_bos_cb, then reproduce the failure using the listed Arduino IDE and board settings. Done means the WebUSB example enumerates correctly on Windows 11.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100