HIL: add a host transfer-abort test for every HCD

Aperta
#4,472 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
c, python

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

follow-up Prio 📌

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 a hil_test.py case and roster entries,
    leaving device_info untouched.
  • 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.
Lingua principale
C
Stelle
7.3k
Fork
1.6k
Merge medio
1g 19h
PR unite (30g)
67

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di hathach/tinyusb

Tutte le issue di hathach/tinyusb

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.