summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2026-08-17Merge pull request #3790 from hathach/fix/lpc43-hfp-reliabilityHa Thach
Fix HFP HIL reliability issue
2026-08-17portable/chipidea: name SBUSCFG in ci_hs_regs_t, unify AHB burst hookhathach
Replace the duplicated per-MCU dispatch in dcd_init/hcd_init and the two helper flavors (USB_Type access on iMX RT, raw offset 0x90 on LPC18/43) with one SBUSCFG register field plus a per-header CI_HS_SET_AHB_BURST() hook, compiled only where defined. The LPC USB0-only policy is now visible at the macro definition.
2026-08-15Merge pull request #3823 from sauloverissimo/feat/midi2-fb-capsZixun LI
midi2 device: complete the UMP stream discovery responder
2026-08-15Merge pull request #3802 from dxbjavid/video-payload-capZixun LI
clamp committed video payload size to streaming ep buffer
2026-08-15Potential fix for pull request findingZixun LI
Co-authored-by: Copilot Autofix powered by AI <[email protected]> Signed-off-by: HiFiPhile <[email protected]>
2026-08-15fix(midi2): fix discovery response racingHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-08-14fix(midi2): keep discovery replies valid under TX pressureSaulo Veríssimo
Text replies resume instead of dropping their tail packets, which used to leave a Start/Continue sequence without an End. A new Function Block Discovery now merges with a pending one instead of replacing it.
2026-08-14feat(midi2): complete the UMP stream discovery responderSaulo Veríssimo
Adds the Device Identity Notification with an app callback, MIDI-CI version and SysEx8 stream count in FB Info, honors the Endpoint Discovery filter bitmap, and paces discovery replies by TX FIFO room.
2026-08-14usbtmc: document why the trigger re-arm result is ignoredice458
A false return from tud_usbtmc_start_bus_read() here does not mean arming failed: it means the endpoint is already armed, either because the application re-armed it from its trigger callback or because a transfer is still queued (usbd_edpt_xfer() reports failure when the endpoint is busy). Both cases end in STATE_IDLE, so the state cannot disambiguate them either, and stalling on the result would halt a healthy endpoint. Co-Authored-By: Claude Opus 5 <[email protected]>
2026-08-14usbtmc: re-arm (or stall) the bulk-OUT endpoint after a USB488 TRIGGERice458
A single USB488 TRIGGER message left the bulk-OUT endpoint un-armed, so the host's next bulk-OUT transfer timed out. The trigger itself succeeded silently, so the failure surfaced on a later, unrelated command; only a USBTMC device clear recovered it. The bundled examples/device/usbtmc reproduced this as shipped. Every other branch of the STATE_IDLE dispatch in usbtmcd_xfer_cb() leaves the endpoint in a defined state: it either transitions out of STATE_IDLE so a later tud_usbtmc_start_bus_read() can re-arm it, or it stalls and lets the CLEAR_FEATURE(ENDPOINT_HALT) handler recover it. USBTMC_MSGID_USB488_TRIGGER did neither, and because the state stayed STATE_IDLE, even an application following the contract documented in usbtmc_device.h got a silent no-op from tud_usbtmc_start_bus_read(). Transition to STATE_NAK so the re-arm can take effect, and stall the endpoint when trigger is unsupported or the application callback rejects it, matching the existing handling for messages the driver cannot process. The callback result is deliberately not wrapped in TU_VERIFY(), which would return before the stall/re-arm and reintroduce the same hang. Since the driver now re-arms after a trigger, drop tud_usbtmc_msg_trigger_cb from the list of callbacks after which the application must do so. Fixes #3821 Co-Authored-By: Claude Opus 5 <[email protected]>
2026-08-13usbd: clear endpoint busy/claimed when a completion event is droppedhathach
An XFER_COMPLETE dropped by a full event queue leaves its endpoint's BUSY|CLAIMED state set forever - the consumer that normally clears it never sees the event, so usbd_edpt_claim()/usbd_edpt_xfer() fail from then on and the class never re-arms the endpoint. Clear both flags when the enqueue fails: the completion is lost either way, but the endpoint stays usable. Unit test: arm a bulk endpoint, drop its completion against a full queue, verify the endpoint can be claimed and re-armed.
2026-08-12usbd: clear the queued-setup counter on bus resethathach
A SETUP counted before a bus reset must not be carried across it: the consumer would either skip a post-reset SETUP (count drained by the stale entry) or, if the count leaked high for any other reason, skip them all. usbd_reset() now zeroes the counter; the consumer already guards on zero, and any pre-reset SETUP still in the queue is stale by definition and correctly discarded.
2026-08-12usbd: don't leak the queued-setup counter when the event queue is fullhathach
A SETUP arriving while the event queue is full is silently dropped by queue_event(), but _usbd_queued_setup has already been incremented. The leaked count makes the event handler skip every subsequent SETUP ("Skipped since there is other SETUP in queue") forever: EP0 stays deaf until tud_init() while the device otherwise looks alive - enumerated, endpoints armed. Undo the increment when the enqueue fails. Unit test: fill the queue so a SETUP is dropped, then verify the next SETUP still completes a GET_DESCRIPTOR control transfer.
2026-08-07Merge pull request #3761 from ↵Zixun LI
morse-cedricvandenbergh/fix/ncm-link-state-notify-retry ncm: retry link-state notification, fix carrier lost on collision
2026-08-07ncm: fix carrier lost on link-state notify collisionCedric Van den Bergh
tud_network_link_state() delivered the NETWORK_CONNECTION notification edge-triggered and fire-once: if a previous notification was still in flight, notification_xmit() returned early and the notification for the new link state was never queued. Because link_is_up is committed before the send, the host could be left reporting a stale carrier state - e.g. a permanent NO-CARRIER after a link up. The notification state was also mutated from both the caller and the notify xfer-completion callback with no serialisation, so on RTOS ports where tud_network_link_state() runs in a task other than tud_task() the two could race. Defer the whole link-state update onto the usbd task, so it can no longer race the completion callback. A collision with an in-flight notification is resolved by re-arming notification_xmit_state and letting the existing completion callback drive it forward on the next xfer completion, rather than adding a separate pending/retry flag. A link toggle does not change the link speed, so strictly only the NETWORK_CONNECTION notification needs (re)sending, but reusing the existing speed-then-connection state machine keeps the fix on a single, already-serialised code path. Closes #3760
2026-08-04audio_device: enforce the documented FIFO minimum in the EP-IN flow-control ↵rt-rtos
guard The comment above audiod_tx_packet_size() states flow control needs a FIFO of at least 4*Navg, but the guard tests nominal_size[1] <= fifo_depth * 4 - true for any FIFO larger than a quarter packet - instead of nominal_size[1] * 4 <= fifo_depth. As written, flow control engages on FIFOs far below its own documented minimum, where the depth/2 setpoint sits within one packet of empty and the packet_size = 0 branch (a zero-length packet, i.e. an audible 1 ms dropout for audio-class hosts) is reachable from ordinary scheduling jitter rather than only from gross clock deviation. With the guard corrected, undersized FIFOs fall back to the plain min(count, max) path as intended.
2026-07-30clamp committed video payload size to streaming ep bufferJavid Khan
Signed-off-by: Javid Khan <[email protected]>
2026-07-30Merge remote-tracking branch 'origin/master' into tmp/pr3790-mergehathach
2026-07-29Merge remote-tracking branch 'tinyusb/master' into fix/lpc43-hfp-reliabilityZixun LI
2026-07-29also added rp2usb_deinit() call to hcd_deinit()Geurt Vos
2026-07-29rp2xxx: added rp2usb_deinit() to fix 'No spinlocks are available'Geurt Vos
2026-07-29Merge pull request #3784 from AnthonyV-modretro/masterZixun LI
Add More HID Usage Page enums
2026-07-29Merge tinyusb/master into fix/lpc43-hfp-reliabilityZixun LI
2026-07-29class/mtp: preserve final OUT payload before ZLPZixun LI
2026-07-28portable/dwc2: rewind DMA on ISO IN retryZixun LI
2026-07-27Address Codex feedback on spellingAnthony VerBurg
2026-07-27portable/chipidea: configure i.MX RT AHB burstsZixun LI
2026-07-27portable/chipidea: configure LPC USB0 AHB burstsZixun LI
2026-07-26TU_MIN suggestionTenGui
2026-07-23save without formattingTenGui
2026-07-23also fix tusb_typesTenGui
2026-07-23fix narrowing, add castTenGui
2026-07-22Add more HID Usage Page enumsAnthony VerBurg
2026-07-21Add support for APM32F072Jie Feng
2026-07-19Merge pull request #3757 from rhgndf/at32f403a_larger_pmaZixun LI
Larger at32f403a PMA area
2026-07-19Merge pull request #3694 from rhgndf/py32f0Zixun LI
Puya PY32F07x support
2026-07-19Potential fix for pull request findingZixun LI
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
2026-07-19Merge pull request #3750 from dxbjavid/cdc-acm-open-desc-boundsZixun LI
bound cdc-data endpoints against descriptor length in acm_open
2026-07-19add assert to dcd_edpt_iso_allocHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-07-19add interface desc length checkHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-07-19improve validation structureHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-07-19improve pointer arithmetic, check funmctional descriptor bLengthHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-07-20return false on too large ep sizesJie Feng
2026-07-19misc fixesJie Feng
2026-07-19add to docsJie Feng
2026-07-19cleanupJie Feng
2026-07-19add py32f0 supportJie Feng
2026-07-19Merge pull request #3775 from hathach/claude/add-usb-debug-sniffHa Thach
usb-target-debug/usb-sniffer skills
2026-07-18fix(ci_fs): address code-review findings in host/device drivershathach
Host (hcd_ci_fs.c): - Release the speculatively-armed sibling BDT on the NAK path (IN only) as well as on completion, so a NAKed multi-packet IN no longer leaks a BDT that stays own=1 and blocks every same-direction pipe. Both paths now go through a single release_sibling_bd() helper (was a copy-pasted disarm). - Clear the ENTIRE shared BDT (both directions) on bus reset; clearing only the IN half left a stale OUT/SETUP descriptor after a disconnect mid-OUT, blocking the first control transfer on re-enumeration. - Size bda[] to span the whole BDT (2*2*4) so STAT-indexed access is within the declared array bounds (was out-of-declared-bounds, benign via union). Shared (ci_fs_type.h): - Hoist buffer_descriptor_t and the TOK_PID enum out of the device and host drivers into the shared header so the identical definitions cannot drift. Board (kinetis_k): - Drop a redundant local in board_get_unique_id. Build-verified: host + kinetis k/kl/k32l + MCX. HIL: frdm_k64f host 2/2 (cdc_msc_hid + device_info); frdm_kl25z device core suite green with the relocated definitions.
2026-07-18dcd_lpc17_40: address review findings in the iso pathshathach
From a second max-effort review of the branch: - Drop the dead TUSB_XFER_ISOCHRONOUS case in dcd_edpt_open: iso endpoints are armed via dcd_edpt_iso_alloc/activate (TUP_DCD_EDPT_ISO_ALLOC is defined for this IP), never through dcd_edpt_open, so the case and its dd->isochronous assignment were unreachable and asserted a false invariant. Only bulk/interrupt reach the switch now. - Extend the iso compile gate to the classes that actually arm an iso endpoint: DCD_ISO_ENABLED now includes CFG_TUD_BTH (bth_device.c opens an iso voice endpoint). Without it a BTH build would compile the iso machinery out and fail SET_INTERFACE at runtime. - Un-skip LPC175X_6X in the usbtest example: it shares dcd_lpc17_40.c with LPC40XX verbatim, so the "DCD has no isochronous support" skip reason no longer holds. Build-verified for lpcxpresso1769 (previously blocked by the skip). - TU_ATTR_UNUSED on the ep_id_is_iso helper: every caller is under #if DCD_ISO_ENABLED, so non-iso builds don't reference it and clang's -Wunused-function (fatal in CI) rejected the build — gcc stays quiet. Verified with the full lpc17 and lpc40 example sets under arm-clang. A fifth finding — bounding control_ep_read's PACKET_READY spin with a timeout — was implemented and REVERTED: a naive 100k-iteration bound fires on legitimately-slow control reads and intermittently drops the device (hardware-proven by interleaved A/B testing against the pre-fix binary). The infinite wait is retained; the read is only reached once out_received/ out_queued signal data is present, so the theoretical IRQ-off hang is not reachable in practice. Re-verified on ea4088_quickstart: usbtest 30/30 (repeated) + HIL 14/14.