Repository navigation
fix(usb_device): esp_tinyusb 3.x with a single TinyUSB copy (fixes manager-on CI builds) - #859
Merged
Merged
Conversation
…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
|
✅Static analysis result - no issues found! ✅ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the
switch_pro/exampleandodrive_native/usb_exampleCI builds (and any other manager-on build of a project that usesusb_device), broken since 2026-10-20 by an upstream release.Cause.
espressif/esp_tinyusb3.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 registrytinyusbcomponent.usb_device's manifest asked forespressif/esp_tinyusb >= 2.0.1andtinyusb >= 0.21.0(the floor for the 5-argumentusbd_edpt_xferthe X-Input class driver needs), so the component manager now resolved esp_tinyusb 3.0.0 plus a second, standaloneespressif/tinyusb 0.21.0~2, and the standalone copy failed withtusb_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_deviceto 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 theusbd_edpt_xfer(..., is_isr)form X-Input uses), notinyusbentry,idf >= 5.3(esp_tinyusb 3.x's floor; CI builds with v6.1). The comment explains why atinyusbdependency must not come back.external/esp-usbsubmodule bumped to theesp_tinyusb 3.0.0release commit (a0b87f8), whosedevice/esp_tinyusb/tinyusbnested submodule is TinyUSB 0.21.0.2;external/tinyusbis removed (nothing else used it) and the 14 manager-off exampleCMakeLists.txtno longer put it onEXTRA_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 includestinyusb_console.hand callstinyusb_console_init(). No other espp source used a removed API:usb_devicenever definedtud_suspend_cb/tud_resume_cb, and no example setsCONFIG_TINYUSB_DESC_SERIAL_STRINGor the removed DCD-mode / callback Kconfigs insdkconfig.defaults.usb_devicestates 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_devicealready did or exposed.Test plan
All on IDF v6.1, esp32s3:
switch_pro/example,odrive_native/usb_example,bldc_haptics/example, resolvingespressif/esp_tinyusb (3.0.0)onlyexternal/esp-usb3.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 warningsswitch_pro/exampleandodrive_native/usb_examplejobs🤖 Generated with Claude Code
https://claude.ai/code/session_01DFjjnq3XCTRAXENSxsCxJU