summaryrefslogtreecommitdiff
path: root/src/portable
AgeCommit message (Collapse)Author
2026-05-25Merge remote-tracking branch 'tinyusb/master' into musb_ep0_raceHiFiPhile
2026-05-24Merge remote-tracking branch 'tinyusb/master' into stm32c5HiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-24dcd/stm32_fsdev: workaround CH32 EP0 premature OUT ACKHiFiPhile
Track EP0 control transfer state from SETUP (direction and wLength) and gate CH32 EP0 handshakes accordingly. Switch EP0 type away from control to bulk to block unsolicited OUT ACKs during control read/write gaps, then restore control type when EP0 transfer is explicitly armed. Signed-off-by: HiFiPhile <[email protected]>
2026-05-23dcd/ch32x: optmize CTRL reg writing, basically revert e14b0e85HiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-23dcd/ch32hs: refactor transfer flowHiFiPhile
Refactor the driver to follow USBFS style for easier maintenance. Replace the old packet/response helpers with explicit queue and update paths for IN and OUT transfers. Introduce transfer validity tracking and per-endpoint data toggle state. Reset toggle state on init, close-all, endpoint close, clear-stall, and bus reset. Initialize endpoint controls consistently in NAK + TOG_0 mode. Tighten EP0 setup/status handling and route transfer IRQ processing through the transfer-flag path. Stop enabling ISO_ACT in INT_EN and clear unhandled interrupt flags explicitly. Signed-off-by: HiFiPhile <[email protected]>
2026-05-23dcd/ch32fs: do not set EP0 to ACK on status completeHiFiPhile
It would casue race condition, SETUP packet is always acked. Signed-off-by: HiFiPhile <[email protected]>
2026-05-23dcd/ch32fs: clear INT flag after processingHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-23dcd/ch32x : code reformatHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-23dcd/ch32fs: set EP to NAK earlier to reduce spuroius transferHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-22dcd/ch32fs: reset EP on clear stallHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-22dcd/ch32fs: fix ISO IN transferHiFiPhile
OUT is still buggy Signed-off-by: HiFiPhile <[email protected]>
2026-05-22dcd/ch32fs: only enable EP0 ACK if no data stage, reduce raceHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-22dcd/ch32fs: reset EP regs on bus resetHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-22Merge remote-tracking branch 'tinyusb/master' into mickabrig7/masterHiFiPhile
2026-05-22Merge remote-tracking branch 'tinyusb/master' into fix/Dwc2Stm32U5HiFiPhile
2026-05-22dwc2: handle EP0 status OUT in RXFLVL interruptHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-15rp2040: fix host SET_REPORT (and any OUT-data control xfer) sending DATA0 ↵Boris Dolgov
instead of DATA1 hcd_edpt_xfer() previously reset ep->next_pid to 1 only when the control endpoint direction changed between stages. That handled IN-data control transfers (e.g. GET_REPORT, GET_DESCRIPTOR) where SETUP is OUT and DATA is IN, but not OUT-data class requests like SET_REPORT, where SETUP and DATA are both OUT and the direction-change check is false. ep->next_pid was left at 0 from hcd_edpt_open(), so the DATA stage went on the wire as DATA0 when the device expected DATA1. Strict devices (observed: Elgato Stream Deck) treat this as a protocol violation and disconnect. Key off "endpoint 0" instead of "direction changed", restoring the previous behavior. Interrupt/bulk endpoints take the ep->interrupt_num > 0 branch above and never reach this code, so they are unaffected.
2026-05-14dcd/musb: defer EP0 SETUP during DATA_IN/STATUS raceHiFiPhile
Handle cases where a new SETUP arrives before the previous control transfer fully completes by buffering the SETUP and replaying it after status completion. Split EP0 DATA state into DATA_IN/DATA_OUT and finalize pending status-out completion before processing deferred SETUP. Signed-off-by: HiFiPhile <[email protected]>
2026-05-14Merge remote-tracking branch 'tinyusb/master' into stm32c5HiFiPhile
2026-05-12dcd/dwc2: fix ISO IN endpoint become disabled after incomplete transferHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-11Merge remote-tracking branch 'tinyusb/master' into stm32c5HiFiPhile
2026-05-11Merge pull request #3632 from hathach/msc_osZixun LI
hcd/dwc2: fix txfifo full check
2026-05-10add stm32c5 supportHiFiPHile
Signed-off-by: HiFiPHile <[email protected]>
2026-05-09dwc2: guard EP0 status completion with armed ZLP stateAlex-Schaefer
Track when an EP0 OUT zero-length transfer is actually armed and require that state before synthesizing a status-stage completion ahead of a co-reported SETUP event. This preserves the validated status-before-SETUP ordering fix while avoiding stale zero-length state from producing spurious EP0 OUT completions.
2026-05-09dwc2: preserve EP0 status completion before SETUPAlex-Schaefer
On STM32 DWC2, SETUP phase done and EP0 OUT transfer complete can be reported together. Processing SETUP first can overwrite control state before the previous zero-length OUT status stage is acknowledged, which causes DFU DNLOAD/GETSTATUS traffic to lose the status ACK and stall. Queue the EP0 OUT zero-length transfer completion before queuing the SETUP event when the endpoint has no pending OUT data and total_len is zero. This keeps TinyUSB control-transfer ordering intact for the combined interrupt case.
2026-05-08nrf5x: request HFCLK in USB_EVT_READY to fix post-SoftDevice deadlockhathach
USB_EVT_DETECTED runs hfclk_enable() which, when SoftDevice is not yet enabled, starts HFXO via direct CLOCK register access. After sd_softdevice_enable() takes over CLOCK, HFXO is physically off again and SD's HFCLK reference count is 0. If USB_EVT_READY is fired post-SD (e.g. on nRF52 via Bluefruit's usb_softdevice_post_enable() when the pre-SD nrfx_power READY callback didn't get to run before nrfx_power was uninited), the wait loop 'while (!hfclk_running()) {}' calls sd_clock_hfclk_is_running() which returns false forever -> deadlock that blocks both USB enumeration and any further app code on the calling thread. Call hfclk_enable() right before the wait so HFCLK is requested in whichever context (SD or direct) is current. hfclk_enable() is idempotent. Reproduces reliably with bleuart on Feather nRF52840 Express flashed via JLink: chip wedges in sd_clock_hfclk_is_running SVC, no USB enumeration, no BLE advertising. With the fix, USB enumerates and BLE advertises as expected.
2026-05-04hcd/dwc2: fix txfifo full checkHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-04-28fix(dcd_ch32_usbfs): fix dropped bulk OUT packets by properly re-arming ↵mickabrig7
EP_RX_CTRL state
2026-04-25Merge branch 'master' into musb-followup-3594hathach
# Conflicts: # src/common/tusb_types.h # src/portable/mentor/musb/dcd_musb.c
2026-04-25separate pipe0 since it is 1 packet per transfer, merge PIPE0 STATUS PENDINGhathach
2026-04-25clean uphathach
2026-04-25musb more ep0 refactor. add back remaining_ctrl for correct ep0 state ↵hathach
transition. handle status out to make sure xfer_complete() not called before dcd_edpt_xfer()
2026-04-24musb migrate to ep0_state, remove setup packet from dcd datahathach
2026-04-24refactor musb ep0 xferhathach
2026-04-23typec/stm32: guard hard reset RX re-arm against uninitialized bufferMike Ajax
2026-04-23typec/stm32: updates based on Copilot reviewMike Ajax
2026-04-23typec/stm32: fix -Wcast-qual error, _rx_buf doesn't need constMike Ajax
2026-04-23typec/stm32: fix three UCPD sink bugs for strict PD 3.0 sourcesMike Ajax
2026-04-23musb double packet for epouthathach
2026-04-23Merge pull request #3590 from ↵Ha Thach
hathach/copilot/extract-hcd-pma-buffer-errata-workaround Refactor STM32 FSDEV PMA errata delay into shared static inline helper and apply to DCD/HCD with overridable timing
2026-04-23Merge pull request #3601 from hathach/fix-conversion-warningsHa Thach
Fix some -Wconversion warnings
2026-04-22Add ESP32-S31 as a supported MCU in TinyUSBigor.masar
2026-04-22musb implement double buffer for txhathach
2026-04-21enable double buffer for tm4chathach
2026-04-21minor clean uphathach
2026-04-21optimize pipe_state_t sram for port with CFG_TUD_ENDPOINT_ONE_DIRECTION_ONLY.hathach
separate process_edpt_n() to process_epin() and process_epout()
2026-04-21refactor interrupt handling and add `pipe_write` to fix IN ZLP issuehathach
2026-04-20improving transfer tracking and adding support for un-armed Rx data handlinghathach
2026-04-17use single volatile counterhathach
2026-04-17Merge pull request #3594Ha Thach
Fix musb RXRDY Clearing