Skip to content

fix(usb_device): esp_tinyusb 3.x with a single TinyUSB copy (fixes manager-on CI builds) - #859

Merged
finger563 merged 1 commit into
mainfrom
fix/esp-tinyusb-3
Oct 23, 2026
Merged

finger563 merged 1 commit into
mainfrom
fix/esp-tinyusb-3

Conversation

@finger563

Copy link
Copy Markdown
Contributor

Summary

Fixes the switch_pro/example and odrive_native/usb_example CI builds (and any other manager-on build of a project that uses usb_device), broken since 2026-10-20 by an upstream release.

Cause. espressif/esp_tinyusb 3.0.0 was published on 2026-10-20. From 3.0 it ships TinyUSB as its own git submodule and no longer depends on the registry tinyusb component. usb_device's manifest asked for espressif/esp_tinyusb >= 2.0.1 and tinyusb >= 0.21.0 (the floor for the 5-argument usbd_edpt_xfer the X-Input class driver needs), so the component manager now resolved esp_tinyusb 3.0.0 plus a second, standalone espressif/tinyusb 0.21.0~2, and the standalone copy failed with tusb_option.h: fatal error: tusb_config.h: No such file or directory (that header is only provided to esp_tinyusb's bundled copy). Reproduced locally with the component manager on before the change.

Fix. Move usb_device to esp_tinyusb 3.x and drop the separate TinyUSB dependency everywhere, as the v3 migration guide asks:

  • components/usb_device/idf_component.yml: espressif/esp_tinyusb: '>=3.0.0' (bundles TinyUSB 0.21.0~2, which carries the usbd_edpt_xfer(..., is_isr) form X-Input uses), no tinyusb entry, idf >= 5.3 (esp_tinyusb 3.x's floor; CI builds with v6.1). The comment explains why a tinyusb dependency must not come back.
  • external/esp-usb submodule bumped to the esp_tinyusb 3.0.0 release commit (a0b87f8), whose device/esp_tinyusb/tinyusb nested submodule is TinyUSB 0.21.0.2; external/tinyusb is removed (nothing else used it) and the 14 manager-off example CMakeLists.txt no longer put it on EXTRA_COMPONENT_DIRS, so manager-off builds also see exactly one TinyUSB. The CI checkout is already recursive.
  • bldc_haptics/example: tusb_cdc_acm.h / tusb_console.h / esp_tusb_init_console() were removed in 3.0 (deprecated since 2.0); it now includes tinyusb_console.h and calls tinyusb_console_init(). No other espp source used a removed API: usb_device never defined tud_suspend_cb / tud_resume_cb, and no example sets CONFIG_TINYUSB_DESC_SERIAL_STRING or the removed DCD-mode / callback Kconfigs in sdkconfig.defaults.
  • READMEs: usb_device states the 3.0 / IDF 5.3 requirement and the one-copy rule; msc_example's manager-off instructions use --recursive external/esp-usb.

No behaviour change for applications: 3.0's other breaking changes (Buffer-DMA only, suspend / resume always dispatched through the device event callback, serial number from the eFuse MAC unless provided) match what usb_device already did or exposed.

Test plan

All on IDF v6.1, esp32s3:

  • Component manager on (registry, as CI builds them): switch_pro/example, odrive_native/usb_example, bldc_haptics/example, resolving espressif/esp_tinyusb (3.0.0) only
  • Component manager off (vendored external/esp-usb 3.0.0 with bundled TinyUSB, as CI builds the usb_device examples): usb_device/example, usb_device/xinput_example, usb_device/msc_example; all six with zero warnings
  • CI matrix green, including the previously failing switch_pro/example and odrive_native/usb_example jobs

🤖 Generated with Claude Code

https://claude.ai/code/session_01DFjjnq3XCTRAXENSxsCxJU

…CI builds)

espressif/esp_tinyusb 3.0.0 (2026-10-20) ships TinyUSB as its own
submodule and no longer depends on the registry `tinyusb` component.
usb_device asked for esp_tinyusb >= 2.0.1 AND tinyusb >= 0.21.0, so the
component manager resolved esp_tinyusb 3.0.0 plus a second standalone
tinyusb 0.21.0~2, which fails with "tusb_config.h: No such file or
directory" (the header is only provided to esp_tinyusb's bundled copy).
switch_pro/example and odrive_native/usb_example broke in CI this way.

usb_device now requires esp_tinyusb >= 3.0.0 (bundling TinyUSB 0.21.0~2,
which has the 5-argument usbd_edpt_xfer the X-Input driver uses) with no
tinyusb entry and idf >= 5.3. external/esp-usb is bumped to the 3.0.0
release commit with its nested tinyusb submodule; external/tinyusb is
removed and the 14 manager-off example CMakeLists no longer add it, so
every build sees exactly one TinyUSB. bldc_haptics/example moves from the
removed tusb_cdc_acm.h / tusb_console.h / esp_tusb_init_console() to
tinyusb_cdc_acm.h / tinyusb_console.h / tinyusb_console_init(). READMEs
document the requirement and the recursive submodule init.

Verified on IDF v6.1 / esp32s3: manager-on switch_pro/example,
odrive_native/usb_example, bldc_haptics/example (resolving esp_tinyusb
3.0.0 only); manager-off usb_device/example, xinput_example, msc_example
against the vendored 3.0.0. All with zero warnings.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DFjjnq3XCTRAXENSxsCxJU
@github-actions

Copy link
Copy Markdown

✅Static analysis result - no issues found! ✅

@finger563
finger563 merged commit d0e07f0 into main Oct 23, 2026
180 checks passed
@finger563
finger563 deleted the fix/esp-tinyusb-3 branch October 23, 2026 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant