HIL: add a host transfer-abort test for every HCD
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- embedded-iot, testing
Research direction
Read the scratch branch claude/dwc2-abort-hil and its existing examples/host/device_info firmware and hil_test.py case to understand the prototype. Add a separate examples/host/abort_test example with its HIL case and roster entries, then enable it for the listed rig boards. Done means the transfer abort phases run on each configured host board and report pass or actionable driver failures.
Written by the indexing model from the issue text.
Description
Follow-up from #4265.
Problem
No HIL test drives tuh_edpt_abort_xfer() on purpose. The current battery reaches the abort path only on a control
timeout, an endpoint close or SET_CONFIGURATION, so regressions like #4405 (an aborted bulk IN completes later with the
next data) and #4152 (the aborted buffer is written after the abort returns) go unnoticed.
Every HCD implements hcd_edpt_abort_xfer() with the same contract (EHCI, OHCI, rp2040 / PIO-USB, MAX3421,
STM32 FSDEV, DWC2), and none besides DWC2 has been checked against it.
Prototype
Branch claude/dwc2-abort-hil (33a794cf0, on top of a317f951c) holds a scratch version used to validate #4265. It is not
mergeable as is: it replaces examples/host/device_info and its hil_test.py case.
The firmware uses only the public host API (tuh_edpt_xfer(), tuh_edpt_abort_xfer(), tuh_bus_info_get()) and the
generic hcd_dcache_* hooks, and prints ABORT_TEST PASS or ABORT_TEST FAIL <reason>. 200 rounds per phase:
- M1: abort a bulk IN on the attached MSC drive while it NAKs (no CBW sent), then a READ10 must return the right
block and CSW (#4405). - M2: abort at a random point during a READ10; the aborted buffer must not change after the abort returns, and the
next READ10 must return the right data (#4152). - S1: abort a NAKing bulk IN on the full-speed CP2102/CH9102 behind the hub, then talk to it again. Split
transactions on a high-speed host; a plain hub-attached abort on a full-speed host.
Results with it:
| Board | Driver | Slave | DMA |
|---|---|---|---|
| espressif_p4_function_ev | #4265 merged | pass | pass |
| stm32f723disco | #4265 merged | pass | pass |
| stm32f723disco | before the #4430 fold (d20ee752e) | fail M2 (#4152) | fail M1 (#4405) |
Remaining work
- Move the firmware into its own example (e.g.
examples/host/abort_test), with ahil_test.pycase and roster entries,
leavingdevice_infountouched. - Enable it on every rig host board with an MSC drive attached: DWC2 (ESP32-P4, ESP32-S3, STM32F723), EHCI
(mimxrt1064_evk), OHCI (ea4088_quickstart), rp2040 (pico, pico2, pico_w), PIO-USB (fruit_jam), MAX3421
(metro_m4_express). Expect new failures on the non-DWC2 drivers; fix or file them per driver. - Later: a periodic (interrupt IN) phase for #4471, and an STM32F4 OTG_FS host run for #4462.
- Dominant language
- C
- Stars
- 7.3k
- Forks
- 1.6k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 67
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hathach/tinyusb
-
follow-up Port WCH USBFS Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
follow-up Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
hil-contract: a background hil_remote.py launch is killed at the Bash default 10 min timeoutPossibly taken @hathach claimed this 16 days ago. Openfollow-up Prio 📌
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
ch32v30x: debug UART loses queued bytes when its TX ring fillsPossibly taken @hathach claimed this 16 days ago. Openfollow-up Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
followup Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
-
Missing slice offset check in jvp_equal fast path corrupts slice comparison and aborts delpathsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
area9innovation/flow9#1805 ·
Maintainers usually reply within 3 days
-
AI:Robustness triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
open5gs/open5gs#5246 · 1 comment ·
Maintainers usually reply within 1 day