Skip to content

Bump tinyusb to include MAX3421E host startup-hang fix (#3748)#11093

Open
mikeysklar wants to merge 1 commit into
adafruit:mainfrom
mikeysklar:tinyusb-oscok-bump
Open

Bump tinyusb to include MAX3421E host startup-hang fix (#3748)#11093
mikeysklar wants to merge 1 commit into
adafruit:mainfrom
mikeysklar:tinyusb-oscok-bump

Conversation

@mikeysklar

Copy link
Copy Markdown
Collaborator

Advances lib/tinyusb from the October 2025 commit to current master so hathach/tinyusb#3748 (MAX3421E USB-host startup-hang fix) is available to build and test, per #10053.

c1bf19ed6 (0.18.0-748) → fcd5a0603 (0.21.0-31). API drift adapted:

  • XFER_RESULT_ABORTED enum → shared-module/usb/core/Device.c
  • usbd_control.c merged into usbd.csupervisor/supervisor.mk
  • TUD_AUDIO_EP_SIZE gained is_highspeed arg → tusb_config.h
  • CFG_TUD_CDC_EP_BUFSIZECFG_TUD_CDC_RX_EPSIZEusb_device.c

Tested: builds clean on adafruit_feather_esp32_v2 (espressif) and feather_m4_express (atmel-samd).

Known blocker — needs @FoamyGuy: nordic doesn't build yet. The same bump reorganized the USB Audio Class descriptor macros (TUD_AUDIO_DESC_*TUD_AUDIO10_/AUDIO20_DESC_*), and shared-module/usb_audio/usb_audio_descriptors.h still uses the old names. That migration is UAC 1.0/2.0-sensitive and wants USB-audio hardware to verify, so it's left for the module owner. (Verified there's no earlier bump point that includes #3748 without this reorg.)

@mikeysklar

mikeysklar commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator Author

@dhalbert -

Flashed and tested USB-host drive detection (MAX3421E FeatherWing, hot-plug SanDisk/PNY/USB-storage) on real hardware with this bump:

Board Firmware Result
Feather ESP32 V2 official CI artifact (this PR) ✅ enumerates 0781:cfcb SanDisk + 154b:005b PNY across hot-swap
Feather RP2350 local build ✅ enumerates SanDisk + PNY
Feather M4 Express local build ✅ boots (device-only; MAX3421E overflows the 512 KB flash by ~11.7 KB, so no host)
Feather nRF52840 Sense local build ✅ enumerates USB-storage + PNY

espressif and atmel-samd build clean in CI as-is.

The RP2350 and nRF52 images above are local builds with CIRCUITPY_USB_AUDIO=0 disabled.

shared-module/usb_audio/usb_audio_descriptors.h still uses under the old names. These seem to be in the process of being migrated those to the TUD_AUDIO20_DESC_* family is the (cc @FoamyGuy). #11058 and #11062

nRF52 needed one more one-liner to build: tinyusb's dcd_nrf5x.c calls nrf_clock_is_running(), but CircuitPython pins nrfx v2.0.0 which only has nrf_clock_hf_is_running(NRF_CLOCK, …). Patched that one call locally to verify the hardware; the proper fix is bumping ports/nordic/nrfx (or upstream tinyusb supporting nrfx v2.0.0).

Neither the audio-disable nor the clock patch is included in this PR.

platform-testing

proof of life

hw-verify-repl-log.txt

@dhalbert

dhalbert commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

@hathach We could use hathach/tinyusb#3748, but we are well behind in circuitpython as you can see above. @mikeysklar has made good progress. Do you have any recommendations or review comments? Thanks.

@hathach

hathach commented Jul 6, 2026

Copy link
Copy Markdown
Member

all changes look good, except the audio since we don't want to haardcode it with FS. Audio HS/FS has different way of calculating timing/samples. It is updated to not hardcored since even with highspeed capable device e.g imxrt, when plugging to FS host, still need to functio as FS audio. However, since cpy mostly work with PC, we can just use the TUD_OPT_HIGH_SPEED.

Advance lib/tinyusb c1bf19ed6 -> fcd5a0603 to pull in hathach/tinyusb#3748
(adafruit#10053), and adapt to its API drift: XFER_RESULT_ABORTED
enum, usbd_control.c merged into usbd.c, TUD_AUDIO_EP_SIZE is_highspeed arg, and
CFG_TUD_CDC_EP_BUFSIZE -> RX_EPSIZE. Builds clean on espressif and atmel-samd;
nordic still needs a usb_audio descriptor macro migration (see PR).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mikeysklar mikeysklar force-pushed the tinyusb-oscok-bump branch from dd830f1 to 894397c Compare July 6, 2026 13:51
@mikeysklar

mikeysklar commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @hathach!

Updated: both TUD_AUDIO_EP_SIZE(...) calls in supervisor/shared/usb/tusb_config.h to now pass TUD_OPT_HIGH_SPEED instead of a hardcoded false

The audio path can't be fully CI-compiled here yet.

  • the bump also reorganized the UAC descriptor macros (TUD_AUDIO_DESC_*TUD_AUDIO20_DESC_*) and shared-module/usb_audio/usb_audio_descriptors.h

  • still uses the old names, so CIRCUITPY_USB_AUDIO boards (nordic, rp2) need that descriptor migration before this compiles clean.

cc @FoamyGuy (#11058 / #11062)

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.

3 participants