Skip to content

lib/tinyusb: Update to version 0.20.0-1086.#19359

Draft
andrewleech wants to merge 1 commit into
micropython:masterfrom
andrewleech:tinyusb-update-0.20
Draft

lib/tinyusb: Update to version 0.20.0-1086.#19359
andrewleech wants to merge 1 commit into
micropython:masterfrom
andrewleech:tinyusb-update-0.20

Conversation

@andrewleech

Copy link
Copy Markdown
Contributor

Summary

Bumps the bundled TinyUSB from 0.19.0-24 (aa0fc2e08) to 0.20.0-1086 (0afee06e9, current upstream master). The submodule pin has not moved since #18406 (Nov 2025); TinyUSB master has since changed the device endpoint-transfer API, so this also adapts the in-tree glue.

API change adapted

TinyUSB added a trailing bool is_isr argument to the device transfer entry points:

  • usbd_edpt_xfer() / usbd_edpt_xfer_fifo() (device stack API)
  • dcd_edpt_xfer() / dcd_edpt_xfer_fifo() (driver entry points)

In-tree changes:

  • extmod/machine_usb_device.c: the single caller is the USBDevice.submit_xfer() path, which runs from the MicroPython scheduler and never an ISR, so it passes is_isr = false.
  • ports/alif/tinyusb_port/tusb_alif_dcd.c: this port ships a custom dcd driver; its two transfer entry points (and the internal dcd_set_address call) take the new argument. It is unused by the driver, matching how the in-tree reference drivers handle it.

Testing

  • rp2 (RPI_PICO) builds clean locally.
  • Other ports rely on this PR's CI to surface per-port breakage.
  • The alif change is untested - I have no alif hardware. The signature update is mechanical, but a maintainer should confirm the is_isr handling is appropriate for that controller.

Out of scope

The tuh_init() -> tusb_init(rhport, rh_init) host-init deprecation is not touched here: there is no USB host code on master (it is only relevant to out-of-tree machine.USBHost work).


Opening as a draft to run the full CI matrix and surface any remaining per-port breakage before review.

@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.51%. Comparing base (5770ced) to head (8b82fb6).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #19359   +/-   ##
=======================================
  Coverage   98.51%   98.51%           
=======================================
  Files         176      176           
  Lines       22904    22904           
=======================================
  Hits        22563    22563           
  Misses        341      341           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown

Code size report:

Reference:  tools/ci.sh: Add new Unix target with terse error messages. [5770ced]
Comparison: lib/tinyusb: Update to version 0.20.0-1086. [merge of 8b82fb6]
  mpy-cross:    +0 +0.000% 
   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
      esp32:    +0 +0.000% ESP32_GENERIC
     mimxrt:  -536 -0.136% TEENSY40
        rp2:  -224 -0.024% RPI_PICO_W[incl -352(bss)]
       samd:  -472 -0.170% ADAFRUIT_ITSYBITSY_M4_EXPRESS[incl +24(bss)]
  qemu rv32:    +0 +0.000% VIRT_RV32

@andrewleech andrewleech force-pushed the tinyusb-update-0.20 branch from 36e1c15 to f53c6f2 Compare June 20, 2026 04:15
The bundled TinyUSB device endpoint-transfer API gained a trailing
`bool is_isr` argument on usbd_edpt_xfer()/usbd_edpt_xfer_fifo() and on
the matching dcd_edpt_xfer()/dcd_edpt_xfer_fifo() driver entry points,
and the stm32_fsdev driver was split into a shared fsdev_common.c.
Adapt the in-tree users so the bump builds across ports:

- extmod/machine_usb_device.c: pass is_isr=false on the
  USBDevice.submit_xfer() path (never an ISR), guarded by
  TUSB_VERSION_NUMBER so ports building against an older bundled
  TinyUSB (e.g. esp32 via ESP-IDF) still compile.
- ports/alif/tinyusb_port: the port's custom dcd driver takes the
  new argument on both entry points (unused by this driver).
- ports/stm32: build the new lib/tinyusb fsdev_common.c, which
  provides the PMA/btable helpers used by dcd_stm32_fsdev.c.

Signed-off-by: Andrew Leech <andrew@alelec.net>
@andrewleech andrewleech force-pushed the tinyusb-update-0.20 branch from f53c6f2 to 8b82fb6 Compare June 20, 2026 04:33
@dpgeorge

Copy link
Copy Markdown
Member

Thanks for doing this. It would be great if we could wait for a release though, and I thought that would be very soon: hathach/tinyusb#3229 (reply in thread)

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.

2 participants