summaryrefslogtreecommitdiff
path: root/src/portable/st
AgeCommit message (Collapse)Author
2026-07-19Merge pull request #3757 from rhgndf/at32f403a_larger_pmaZixun LI
Larger at32f403a PMA area
2026-07-19Potential fix for pull request findingZixun LI
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
2026-07-09dcd(fsdev): don't disarm an armed endpoint on clear-halt toggle resethathach
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HeF2gZ1M7GWkz6Av4BpKPg
2026-07-06Set larger AT32 FSDEV PMA areaJie Feng
2026-07-02license: use SPDX identifiers for src/ headers (#3749)Ha Thach
* license: use SPDX identifiers for src/ headers Replace the full ~20-line MIT license boilerplate on every src/ file with a two-line SPDX tag (SPDX-FileCopyrightText + SPDX-License-Identifier), following the REUSE convention used by CircuitPython and the Linux kernel. Removes ~3500 lines of duplicated boilerplate.
2026-06-25Merge pull request #3616 from michaelajax/fix-stm32-usbcZixun LI
typec/stm32: fix UCPD sink bugs affecting compatibility with newer PD sources
2026-06-24skip cable-plug trafficHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-06-24apply review suggestionsHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-06-24typec: add tuc_connect/tuc_disconnect apiHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-06-24typec: add stm32u5 supportHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-06-24Merge pull request #3648 from hathach/ch32_fsdevHa Thach
dcd/stm32_fsdev: workaround CH32 EP0 premature OUT ACK
2026-06-23Merge remote-tracking branch 'tinyusb/master' into fix-stm32-usbcHiFiPhile
2026-06-18fix(stm32_fsdev): don't enable the unused USB wakeup EXTI IRQ (F1/F3/G4/L1)hathach
The classic-USB STM32 fsdev driver enabled the EXTI-line USB wakeup interrupt (USBWakeUp_IRQn, and USBWakeUp_RMP_IRQn on the F3 remap path) in the NVIC, but never uses it: resume is serviced in-band via ISTR.WKUP in the USB_LP/HP ISR, and the driver never arms or clears that EXTI line. The wakeup EXTI interrupt is only needed to wake the core from STOP mode, which TinyUSB does not implement. Leaving its NVIC vector enabled lets it fire spuriously into an unhandled or looping vector -- the freeze reported in #3696 on STM32G473. USBWakeUp_IRQn is a valid, dedicated USB-wakeup-via-EXTI interrupt (e.g. stm32g473xx.h: =42 "USB Wakeup through EXTI line"), not an "unrelated interrupt"; it is simply unused here. - Comment out USBWakeUp_IRQn for F1/F3/G4/L1 and USBWakeUp_RMP_IRQn on the F3 remap path, kept in place so STOP-mode wakeup is a one-line re-enable. - Keep the STM32L1 USBWakeUp_IRQn -> USB_FS_WKUP_IRQn alias for that re-enable. - Document the rationale in fsdev_stm32.h with a TODO. - Comment out the matching USBWakeUp(_RMP)_IRQHandler in the F1/F3/G4 BSPs, and the FreeRTOS NVIC_SetPriority(USBWakeUp_IRQn) on F1/G4. Fixes #3696 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-18dcd/stm32_fsdev: restore CH32 EP0 CONTROL type when stallinghathach
The CH32 workaround only restored EP0 to CONTROL in edpt_xfer(). When the stack rejects a control write with data (handle_ctr_setup having already switched EP0 to BULK) it stalls EP0 via dcd_edpt_stall() without ever calling dcd_edpt_xfer(), leaving EP0 typed BULK+STALL. As SETUP recognition is tied to CONTROL-typed endpoints, the host's recovery SETUP (which should auto-clear the stall) would be ignored, wedging EP0 until a bus reset. Restore CONTROL for EP0 in the same exclusive write that sets the STALL status. DFU download-in-wrong-state is a concrete trigger. Co-Authored-By: Claude Fable 5 <[email protected]>
2026-06-18dcd/stm32_fsdev: restore CH32 EP0 CONTROL type atomically with arminghathach
edpt_xfer() restored EP0 to CONTROL at the top of the function, before the OUT stage was armed (rx bufsize + STAT_RX=VALID written further down, with interrupts enabled in between). That re-enabled the CH32 blind OUT ACK while STAT_RX was still NAK and the buffer size stale, so a host-retried DATA OUT / status ZLP could be ACKed into the wrong buffer in the gap. Fold the CONTROL restore into the single exclusive write that programs STAT_RX=VALID for the OUT direction, after the buffer size is set, so type and arming go live together. The IN direction keeps the (now atomic) early restore, where no pending OUT exists to be blind-ACKed. Co-Authored-By: Claude Fable 5 <[email protected]>
2026-06-18dcd/stm32_fsdev: tidy CH32 EP0 setup parsing and whitespacehathach
Parse the setup packet via tusb_control_request_t instead of hand-rolled byte indexing; drop a stray blank line and fix indentation. No functional change. Co-Authored-By: Claude Fable 5 <[email protected]>
2026-06-18dcd/stm32_fsdev: make CH32 ep0_set_type read-modify-write atomichathach
ep0_set_type() read the EP0 register outside any critical section and only ep_write() masked the USB IRQ around the store. A USB interrupt landing between the read and the write (e.g. a new SETUP whose handler installs the BULK gate) was silently undone when the task resumed and wrote back its pre-interrupt snapshot with the type forced to CONTROL, re-exposing the unsolicited EP0 OUT ACK the workaround blocks. Bracket the whole read-modify-write with fsdev_int_disable/enable when called with need_exclusive (task context). ISR-context callers pass false and are unaffected (the ISR cannot preempt itself). Co-Authored-By: Claude Fable 5 <[email protected]>
2026-06-12Merge branch 'master' into ch32_fsdevHa Thach
2026-05-25optimize interrupt handling timeHiFiPhile
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-10add stm32c5 supportHiFiPHile
Signed-off-by: HiFiPHile <[email protected]>
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-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-17use single volatile counterhathach
2026-04-17fix some Wconversion warningshathach
2026-04-10debloat the workaroundHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-04-10Allow STM32 FSDEV delay override macros to satisfy 32-bit guardcopilot-swe-agent[bot]
Agent-Logs-Url: https://github.com/hathach/tinyusb/sessions/b35badc2-444a-4329-b136-f314591cf693 Co-authored-by: HiFiPhile <[email protected]>
2026-04-10Restore errata context comment on inline delay helpercopilot-swe-agent[bot]
Agent-Logs-Url: https://github.com/hathach/tinyusb/sessions/8588a09c-d4e5-4284-8944-47ae4e2a2a1f Co-authored-by: HiFiPhile <[email protected]>
2026-04-10Make fsdev errata delay helper static inlinecopilot-swe-agent[bot]
Agent-Logs-Url: https://github.com/hathach/tinyusb/sessions/8588a09c-d4e5-4284-8944-47ae4e2a2a1f Co-authored-by: HiFiPhile <[email protected]>
2026-04-09Polish FSDEV delay code readabilitycopilot-swe-agent[bot]
Agent-Logs-Url: https://github.com/hathach/tinyusb/sessions/3ec0d5b6-cb8e-48ff-8606-3371beb1efcb Co-authored-by: HiFiPhile <[email protected]>
2026-04-09Clarify STM32U0 delay-default frequency usagecopilot-swe-agent[bot]
Agent-Logs-Url: https://github.com/hathach/tinyusb/sessions/3ec0d5b6-cb8e-48ff-8606-3371beb1efcb Co-authored-by: HiFiPhile <[email protected]>
2026-04-09Simplify delay loop comment in shared FSDEV helpercopilot-swe-agent[bot]
Agent-Logs-Url: https://github.com/hathach/tinyusb/sessions/3ec0d5b6-cb8e-48ff-8606-3371beb1efcb Co-authored-by: HiFiPhile <[email protected]>
2026-04-09Decouple DCON stabilize delay from BTABLE errata macrocopilot-swe-agent[bot]
Agent-Logs-Url: https://github.com/hathach/tinyusb/sessions/3ec0d5b6-cb8e-48ff-8606-3371beb1efcb Co-authored-by: HiFiPhile <[email protected]>
2026-04-09Restore compile-time guard for STM32 FSDEV delay defaultscopilot-swe-agent[bot]
Agent-Logs-Url: https://github.com/hathach/tinyusb/sessions/3ec0d5b6-cb8e-48ff-8606-3371beb1efcb Co-authored-by: HiFiPhile <[email protected]>
2026-04-09Document and polish shared FSDEV errata delay helpercopilot-swe-agent[bot]
Agent-Logs-Url: https://github.com/hathach/tinyusb/sessions/3ec0d5b6-cb8e-48ff-8606-3371beb1efcb Co-authored-by: HiFiPhile <[email protected]>
2026-04-09Refactor STM32 FSDEV PMA errata delay into common helpercopilot-swe-agent[bot]
Agent-Logs-Url: https://github.com/hathach/tinyusb/sessions/3ec0d5b6-cb8e-48ff-8606-3371beb1efcb Co-authored-by: HiFiPhile <[email protected]>
2026-03-18fix bugs in fsdev hcd, dcd and midi host stream writehathach
- hcd_edpt_clear_stall: use ep_addr instead of hardcoded 0 (control endpoint) - hcd: add TUP_USBIP_FSDEV_DRD define for MCUs with host support (C0, G0, H5, U3, U5) and use it in hcd compile guard instead of enumerating MCUs - dcd_edpt_close_all: use FSDEV_EP_COUNT instead of CFG_TUD_ENDPPOINT_MAX for PMA btable offset to match handle_bus_reset - midi host tuh_midi_stream_write: add missing cable_num to system messages, SysEx, and real-time MIDI packets. Add 0xF mask for SysEx CIN checks. Aligns with midi_device.c tud_midi_n_stream_write implementation. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-03-16clean up fsdev symbolshathach
2026-03-16Unify USB FSDEV driver implementation for various microcontrollers. Replace ↵hathach
`FSDEV_BUS_32BIT` with `CFG_TUSB_FSDEV_32BIT`, adjust data/address stride macros, and refactor register/PMU access for consistency across platforms.
2026-03-16Consolidate USB FSDEV register definitions for STM32, CH32, and AT32 ↵hathach
microcontrollers. Replace vendor-specific macros with unified `U_`-prefixed equivalents, ensuring consistency and reducing duplication across all platforms.
2026-02-27Merge remote-tracking branch 'tinyusb/master' into dwc2_deinitHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-02-05reverse pma size check to reduce duplicationhathach
2026-01-26fix stm32u0 data strideZixun LI
Signed-off-by: Zixun LI <[email protected]>
2026-01-24Fix macro directive for FSDEV of CH32V20xMitsumine Suzu
2026-01-06hcd/stm32_fsdev: fix init after device modeHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-01-06rename FSDEV_PMA_SIZE CFG_TUSB_FSDEV_PMA_SIZEhathach
2026-01-03add default access mode for tu_hwfifo API make it easier for non-custom ↵hathach
read/write