summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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-12ohci: fix double allocation of dummy TDs in gtd_find_freeRyzee119
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-07test/fuzz: stub usbd_defer_func in net_ncm harnessCedric Van den Bergh
The self-contained net_ncm fuzz harness #includes ncm_device.c and stubs the usbd symbols it references rather than linking the device stack. tud_network_link_state() now calls usbd_defer_func(), so add a matching no-op stub to keep the harness linking.
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-05Merge pull request #3809 from rt-rtos/audio-fix-flow-control-fifo-guardZixun LI
audio: fix inverted FIFO-size guard in EP-IN flow control
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-31test/hil: fold openocd_wch into openocd, verify per board, resolve firmware ↵Ha Thach
by flasher extension (#3804) test/hil: one openocd flasher, per-board verify and firmware extension The four WCH boards move to `openocd`, leaving one flasher for all. `verify` is now a per-board opt-out, not dropped fleet-wide: WCH cannot read flash back over the WCH-Link sdi transport; the other seven openocd boards can, and say so explicitly. FLASHER_SUFFIX decides each flasher's extension once — find_firmware returns the full path and the flashers pass it through, so a build with only the wrong artifact is skipped rather than failed mid-flash. --skip-flash bypasses the filter. rescue_openocd() power-on-resets a wedged RP2040/RP2350 via its Rescue DP from the flash retry; the probe has no reset line. Drops unused openocd_adi, stflash, wlink_rs and uniflash, parks the unstable ra6m5_ek, and tests that every roster flasher name dispatches.
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-30hil, ci: scope HIL builds and tests to the boards a PR affects (#3797)Ha Thach
hil, ci: scope HIL builds and tests to the boards a PR affects Add test/hil/hil_select.py, a stdlib-only selector that maps a PR diff to the rig boards, tests and BSP families a change can affect, and wire it into CI so pull requests build and run only those. A port change picks its families' boards, a class change picks the examples enabling that class, and device/host changes prune the other role. Anything unclassified — infra, an unmapped port, a selector error — falls back to the full matrix, and push/schedule runs are untouched. Move the shared example lists to hil_examples.py; 54 hardware-free tests cover the rules.
2026-07-29Merge pull request #3796 from geurtv/masterZixun LI
rp2xxx: added rp2usb_deinit() to fix 'No spinlocks are available'
2026-07-29Merge remote-tracking branch 'tinyusb/master' into fix/lpc43-hfp-reliabilityZixun LI
2026-07-29hil: split hil_test.py into hil_lock/hil_flash, add pool_check, update rig ↵Ha Thach
probes (#3794) test/hil: add board-pool health check, split hil_test into focused modules (#3794) Add test/hil/hil_pool_check.py: per-board rig health scan — probe presence, light-example flash (dfu_runtime; device_info + serial check for host-only boards), uid re-enumeration, safe recovery (probe authorized-toggle, board reset), verified board_test re-park, USB topology report, and a markdown summary table. Missing firmware is built on the spot (tools/build.py, idf.py for espressif, one get_deps retry); row statuses: ok, flash-failed, failed, locked. Board locks are always respected, never bypassed. Refactor hil_test.py into hil_lock.py (flock protocol, controller permits, hold/release/status CLI; replaces board_lock.py) and hil_flash.py (flashers, find_firmware, run_cmd). Update WCH probe uids and the board roster in tinyusb.json; add the hil-pool-check skill.
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-29test/hil: make MTP checks deterministicZixun LI
2026-07-29class/mtp: preserve final OUT payload before ZLPZixun LI
2026-07-28test/hil: avoid parallel MTP probe racesZixun LI
2026-07-28test/hil: allow audio startup transitionZixun LI
2026-07-28hw/bsp/stm32l4: stabilize L412 USB clockZixun LI
2026-07-28portable/dwc2: rewind DMA on ISO IN retryZixun LI
2026-07-28test/hil: require exact audio rampZixun LI
2026-07-28Revert 'test/hil: separate LPC43 stress test flashes'Zixun LI
This reverts commit 80ffbff6e98a9c5053bba008ae2c5087f0351300.
2026-07-28test/hil: use stlink for stm32l412nucleoZixun LI
Signed-off-by: Zixun LI <[email protected]>
2026-07-28Merge pull request #3792 from hathach/claude/openocd-docsHa Thach
docs: add the unified OpenOCD plan, note worktree dep symlinks
2026-07-28docs: add the unified OpenOCD plan, note worktree dep symlinkshathach
The plan doc records why the fork exists and how each vendor source was ported; the interim handoff it superseded is dropped. CLAUDE.md: a new worktree should symlink the dependency dirs to the primary checkout rather than re-fetching them, replacing a single symlink only when the branch needs a different dep revision. Also allow 'linke' in codespell - WCH-LinkE is a product name.
2026-07-28bsp, hil: flash WCH boards with the unified OpenOCD fork (#3791)Ha Thach
bsp, hil: flash with the unified OpenOCD fork https://github.com/hathach/openocd (branch tinyusb) is mainline plus every config these boards need: RPi RP2350, ADI max32/max78, the MounRiver WCH configs, and the wlinke adapter on mainline's riscv target. It is a superset of the vendor forks, so one 'openocd' covers all boards; -DOPENOCD=/OPENOCD= still select another, msdk's when MAXIM_PATH is set. Drops family_flash_openocd_wch and the OPENOCD_WCH pair, dedups family_flash_openocd_adi, aligns ch583's work area, and points hil at the flasher's own config instead of generating one per probe. Verified: HIL green on all four WCH boards and max32666fthr.
2026-07-27Address Codex feedback on spellingAnthony VerBurg
2026-07-27hw/bsp/lpc43: configure safe flash timingZixun LI
2026-07-28test/hil: replace PCI reset with root-port VBUS cycle for D-state recovery ↵Ha Thach
(#3789) test/hil: replace PCI reset with root-port VBUS cycle for D-state recovery pci-reset was documented as an FLR, but no controller on either rig has FLR, so it issued a PCIe secondary bus reset on a live, driver-bound xHCI -- halting the card until the PVE host was power-cycled, and returning success so the caller could not tell. It destroyed the ci controller twice. Replace it with root-cycle, which cuts VBUS at the xHCI root port and touches only the root hub, so it never takes the per-device lock the wedged ioctl holds. uhubctl needs -S, or its sysfs backend disconnects the child before cutting power and blocks on that same lock. Success is proven by the device's sysfs directory inode changing: node existence proves nothing, and devnum is reused once the per-bus map wraps. usbtest.py's hang path invokes it, then confirms via /proc that nothing still holds the device node. Skill scripts now run from the repo; the drifted /usr/local/sbin copies are deleted.
2026-07-27test/hil: bound MIDI reads by deadlineZixun LI
2026-07-27hw/bsp/lpc43: reset peripherals on IAR restartZixun LI
2026-07-27portable/chipidea: configure i.MX RT AHB burstsZixun LI
2026-07-27test/hil: separate LPC43 stress test flashesZixun LI
2026-07-27portable/chipidea: configure LPC USB0 AHB burstsZixun LI
2026-07-26Merge pull request #3785 from TenGui/tud_descriptor_narrowingZixun LI
Cast BMaxPower in TUD_CONFIG_DESCRIPTOR to uint8_t
2026-07-26TU_MIN suggestionTenGui
2026-07-26Merge pull request #3788 from rhgndf/apm32f0-depsZixun LI
Enable APM32F0 dependency fetching and CI
2026-07-25refresh presetsZixun LI
Signed-off-by: Zixun LI <[email protected]>
2026-07-25Run APM32F0 CPU and USB from 48 MHz PLLJie Feng
2026-07-25Enable APM32F0 dependency fetching and CIJie Feng
2026-07-24Merge pull request #3787 from hathach/claude/add-etm-trace-skillHa Thach
Add etm-trace skill: unattended ETM instruction trace + per-board TRACE_ETM support
2026-07-24address #3787 Codex round 3: coverage keys, RA attach limitationhathach
Coverage rows now resolve the de-collided module-qualified key introduced for same-named statics. RA boards: document that --attach requires a debugger-booted target - the C_DEBUGEN gate exists because an unguarded TRCKCR write bricks standalone boots (hardware-proven), so the limitation is documented rather than the guard weakened; a debugger-side TRCKCR hook can lift it later once re-verified on hardware. The stm32n6 board-gating suggestion is not taken: N6 trace pins are AF0-fixed chip-level, the same family-wide pattern as stm32h7.
2026-07-24address #3787 Codex round 2: board-gate PHY resets, session robustnesshathach
The board-specific PHY-reset nets move behind a board.h opt-in (TRACE_ETM_QUIET_ENET_PHY on same70_xplained and mimxrt1170_evkb) so other boards of those families cannot inherit a foreign GPIO write; the chip-level trace pin muxes stay family-wide by design (same pattern as stm32h7). same70 reference: width 1 is the validated default until the J403.16 rework, and the hooks now wait (bounded) for PCKRDY3 before Ozone arms trace. ra8m1 reference caches the boot ROM in AfterTargetConnect so --attach sessions decode ROM execution too. etm_capture rejects an unexpanded CMake JLINK_DEVICE with a clear error; PIO-USB + TRACE_ETM on RP2350 is now a compile error (48 MHz trace clock is too slow for PIO-USB and a runtime switch would desync the stream); etm_profile keeps same-named statics from different modules as distinct rows. Build-verified: same70_xplained, mimxrt1170_evkb, raspberry_pi_pico2.
2026-07-24address #3787 reviews: bsp fixes, script hardening, board-note accuracyhathach
Bot findings (Copilot/Codex): no-op board_trace_pinmux stubs for lpcxpresso18s37/43s67 (TRACE_ETM otherwise broke their build), SAME70 ID_PIOD clock enable, capture-script duplicate BeforeTargetConnect on the RA references, profile-script support for --no-timestamps itraces. Deep review (whole branch): same70_xplained board row + caveat restored, stale pico2 72 MHz claim corrected to the shipped 48, explicit SetTracePortWidth(4) in the three references that relied on Ozone's default, coverage-cell guard, median-based SysTick calibration, dead session flag removed, stale RA8M1 divider comment fixed (0x02 = /4 is the validated chip max) and the debugger guard indented. EVKB bench findings: only R1884/D3 remains open (D1/D2 meter-verified); RT1176 trace width is 1 or 4 only - J-Link arms the CSSYS TPIU and its own sampler at 4-bit for any width>=2 request; a powered MCU-Link USB breaks the external probe even with JP4 shorted.
2026-07-24imxrt: hold EVKB Ethernet PHY in reset while tracing, 50 MHz trace pinhathach
Fresh bring-up pass on mimxrt1170_evkb: holding the 100M RTL8201 in reset (ENET_RST_B = GPIO_LPSR_04) stops its RMII lines driving against the shared trace pads and doubles the clean trace-pin rate to 50 MHz (100 MHz CSTRACE root; 133 MHz root is marginal, stock 132 corrupts). Validated 3x 8 s TinyUSB captures at 11.46M fetches. D1-D3 remain silent in every configuration - the welded R1882-R1884 are electrically open; reflow is the remaining step to width 4. Board notes gain JP4 (must be shorted for an external probe on J58).