update tinyusb core to commit dcd2a4b - #578
Merged
hathach merged 1 commit intoMay 11, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR syncs the vendored TinyUSB core in this Arduino library to upstream commit dcd2a4b, incorporating upstream fixes/features (including a new printer device class) and updating multiple portable backends and core internals (endpoint state handling, control EP flow, endianness handling).
Changes:
- Refactors endpoint state tracking from a bitfield struct to
uint8_tbitmasks and updates host/device stacks accordingly. - Moves/merges control endpoint handling into
usbd.cand normalizes SETUP packet endianness conversion in the DCD event helper. - Updates multiple port layers (notably DWC2, STM32 FSDEV, RP2040) and adds the new
src/class/printer/device class.
Reviewed changes
Copilot reviewed 52 out of 52 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tusb.c | Updates endpoint claim/release helpers to operate on uint8_t bitmasks. |
| src/tusb_option.h | Adds ESP32-S31 MCU option; removes CFG_TUSB_OS_HAS_SCHEDULER definition. |
| src/portable/synopsys/dwc2/hcd_dwc2.c | Updates DFIFO sizing and adds clock init hook call before register access. |
| src/portable/synopsys/dwc2/dwc2_xmc.h | Switches controller config to otg_dfifo_depth and adds dwc2_clock_init() stub. |
| src/portable/synopsys/dwc2/dwc2_type.h | Renames controller SRAM sizing field; adds a new DWC2 core revision constant. |
| src/portable/synopsys/dwc2/dwc2_stm32.h | Converts FIFO sizing to DFIFO depth (words) and adds dwc2_clock_init() stub. |
| src/portable/synopsys/dwc2/dwc2_nrf.h | Adds nRF54 support pieces, device-only clock init sequencing, and D-cache no-op stubs. |
| src/portable/synopsys/dwc2/dwc2_info.py | Updates/extends DWC2 register snapshots (adds nRF54 variants). |
| src/portable/synopsys/dwc2/dwc2_info.md | Updates the rendered DWC2 register comparison table. |
| src/portable/synopsys/dwc2/dwc2_gd32.h | Switches to DFIFO depth (words) and adds dwc2_clock_init() stub. |
| src/portable/synopsys/dwc2/dwc2_esp32.h | Adds ESP32-S31 support and adjusts USB_WRAP usage/guards; adds dwc2_clock_init() stub. |
| src/portable/synopsys/dwc2/dwc2_efm32.h | Switches to DFIFO depth and adds dwc2_clock_init() stub. |
| src/portable/synopsys/dwc2/dwc2_common.h | Updates port-header requirements doc to include dwc2_clock_init(). |
| src/portable/synopsys/dwc2/dwc2_bcm.h | Switches to DFIFO depth and adds dwc2_clock_init() stub. |
| src/portable/synopsys/dwc2/dwc2_at32.h | Switches to DFIFO depth (words) and adds dwc2_clock_init() stub. |
| src/portable/synopsys/dwc2/dcd_dwc2.c | Updates DFIFO sizing logic; adds clock init hook call; ESP32S31 USB_WRAP guard tweaks. |
| src/portable/st/stm32_fsdev/hcd_stm32_fsdev.c | Reworks PMA/BTABLE timing workaround usage and connection-stabilize delay. |
| src/portable/st/stm32_fsdev/fsdev_stm32.h | Adds centralized BTABLE errata delay helper and related config macros. |
| src/portable/st/stm32_fsdev/fsdev_common.h | Fixes shift literal typing (1u) for CTR bit manipulation. |
| src/portable/st/stm32_fsdev/fsdev_common.c | Adds explicit casts for tu_div_ceil() results into uint8_t. |
| src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c | Uses centralized BTABLE delay helper; tightens integer casts for PMA addresses/ids. |
| src/portable/renesas/rusb2/dcd_rusb2.c | Improves casts/typing around endpoint addressing, loops, and register writes. |
| src/portable/raspberrypi/rp2040/rp2040_usb.h | Major RP2040 backend refactor: errata flags, endpoint state model, locking, and APIs. |
| src/portable/raspberrypi/rp2040/rp2040_usb.c | Major RP2040 backend refactor: buffer control writes, errata handling, transfer flow changes. |
| src/portable/raspberrypi/rp2040/dcd_rp2040.c | Major RP2040 DCD refactor: buffer/EP register helpers, SOF/errata handling, stall/abort updates. |
| src/portable/nordic/nrf5x/dcd_nrf5x.c | Adds additional GCC warning suppression; ensures HFCLK request on power event path. |
| src/osal/osal_mynewt.h | Adds ms→tick helper and enables timeout-capable osal_queue_receive() via os_eventq_poll(). |
| src/host/usbh.c | Converts endpoint state to bitmasks; improves defer timing readiness logic and clearing semantics. |
| src/device/usbd.h | Updates CDC-NCM descriptor template parameters (notif interval, capability). |
| src/device/usbd.c | Major control EP refactor merged into usbd core; converts endpoint state to bitmasks; SETUP parsing changes. |
| src/device/usbd_pvt.h | Removes debug-only control-complete driver name helper declaration. |
| src/device/usbd_control.c | Deletes standalone control EP implementation (folded into usbd.c). |
| src/device/dcd.h | Converts SETUP packet multi-byte fields to host-endian in dcd_event_setup_received(). |
| src/common/tusb_types.h | Normalizes tusb_dir_t, adds TU_EP0 constants, and makes bitfield layout explicit for LE/BE. |
| src/common/tusb_private.h | Replaces tu_edpt_state_t bitfield struct with uint8_t state bit masks and updates APIs. |
| src/common/tusb_mcu.h | Adds ESP32-S31 support and introduces CFG_TUD_ENDPOINT_ONE_DIRECTION_ONLY defaulting + legacy aliasing. |
| src/common/tusb_fifo.c | Adds casts to avoid implicit narrowing and fixes odd/even calculations with stride masks. |
| src/common/tusb_compiler.h | Introduces TU_BITFIELD_LE/BE and sets TU_BITFIELD_ORDER alongside byte order. |
| src/class/printer/printer.h | Adds new printer class definitions (requests/status). |
| src/class/printer/printer_device.h | Adds printer device public API, callbacks, and driver hooks. |
| src/class/printer/printer_device.c | Implements printer device class with endpoint streams and class-specific control handling. |
| src/class/net/net_device.h | Adds NCM capability bits type and packet filter callback declaration; removes endpoint-size macro. |
| src/class/net/ncm.h | Adds CDC-NCM functional descriptor structs and NTB input size struct. |
| src/class/net/ncm_device.c | Tracks endpoint size at runtime, adds packet-filter + NTB input size GET/SET handling, and host-configurable TX limits. |
| src/class/net/ecm_rndis_device.c | Tracks endpoint size at runtime, adds packet-filter callback, and adjusts link speed reporting and ZLP behavior. |
| src/class/mtp/mtp.h | Fixes MTP string length handling (uint8 length semantics) and adds bounds assertions. |
| src/class/mtp/mtp_device.h | Clarifies that string fields are appended (comment-only update). |
| src/class/mtp/mtp_device.c | Removes redundant endian conversion for setup wLength (now pre-converted). |
| src/class/midi/midi_host.h | Expands docs about FIFO draining behavior for stream reads. |
| src/class/hid/hid_host.h | Adjusts callback comment wording. |
| src/class/hid/hid_host.c | Adds weak stub for tuh_hid_report_received_cb() and condenses unused-arg stubs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
hathach
deleted the
update-tinyusb-commit-dcd2a4bd0f005835d3edc193309ef3484cd9c8b3
branch
May 11, 2026 05:08
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.
Sync vendored TinyUSB core to upstream commit dcd2a4bd0f005835d3edc193309ef3484cd9c8b3.
src/class/,src/common/,src/device/,src/host/,src/osal/,src/portable/plussrc/tusb.c/src/tusb.h/src/tusb_option.hfrom upstreamsrc/class/printer/(printer device class)src/device/usbd_control.c(deleted upstream; folded intousbd.c)ARDUINO_ARCH_ESP32patch insrc/tusb_option.h🤖 Generated with Claude Code