host: local data toggle reset unsupported on rp2040, pio-usb, WCH USBFS, MAX3421E, RUSB2 and non-halted OHCI EDs

Aperta
#4,490 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
c

Direzione di ricerca

Read the HCD implementations named in the issue: hcd_rp2040.c, hcd_ch32_usbfs.c, hcd_max3421.c, hcd_pio_usb.c, hcd_rusb2.c, and ohci.c, along with each controller’s reference manual and errata. Then validate tuh_msc_reset() on hardware for each board family, followed by TEST UNIT READY and a known-data read without re-enumeration. The work is done when all six HCD cases pass validation and their ports are removed from the unsupported list in docs/reference/class/msc.rst.

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

Descrizione

follow-up Prio 📌

Follow-up from #4009, which adds tuh_msc_reset() (BOT Reset Recovery). After each CLEAR_FEATURE(ENDPOINT_HALT) it
calls the new usbh_edpt_clear_stall() → hcd_edpt_clear_stall() to reset the host toggle to DATA0 (USB 2.0
§9.4.5). On the HCDs below this returns false, so tuh_msc_reset() always fails and leaves the interface fenced.

Remaining work

HCD State in #4009 What a fix needs
rp2040 (hcd_rp2040.c) false (was panic()) ep->next_pid = 0 on the idle endpoint; it is loaded into USB_BUF_CTRL_DATA1_PID when the buffer is armed
WCH USBFS (hcd_ch32_usbfs.c) false; the old body, which sent its own blocking CLEAR_FEATURE, is kept as send_clear_stall_sync() for the internal STALL path edpt_info->data_toggle = 0; it feeds the HOST_TX_CTRL/HOST_RX_CTRL TOG bits in hardware_start_xfer()
MAX3421E (hcd_max3421.c) false (unchanged) ep->data_toggle = 0; it becomes the HCTL_SNDTOG0/1/RCVTOG0/1 write
pio-usb (hcd_pio_usb.c) false (was a no-op true) endpoint_t.data_id lives in the Pico-PIO-USB library; needs a library accessor (the library is not modified from TinyUSB)
RUSB2 (hcd_rusb2.c) false; orphan addr_to_pipectr() removed The old body had two defects (below); rewrite with the documented sequence
OHCI (ohci.c) refuses unless the ED is halted Set sKip, wait a frame so the HC is not processing the ED, write toggleCarry, clear sKip
RUSB2 evidence (old body, removed in #4009)
  • addr_to_pipectr() indexed _hcd.ep[dev_addr]; every writer and reader uses [dev_addr - 1] (:326, :561,
    :650). For address 1 it resolved to DCPCTR (another device's row is 0), so SQCLR hit the control pipe and the
    bulk pipe's toggle was never reset; address 4 indexed past the array.
  • SQCLR was written while an OUT pipe could still be at PID=BUF. RA6M5 HW UM Rev 1.50 (Calibre 5584) §28.2.35 p866
    Note 2: set PID to NAK and wait for PBUSY=0 before SQCLR. Lookups 5c099c15f415, 7ecc06fec180.
OHCI evidence

OHCI 1.0a §4.2.3 (Calibre 774, printed p18 / PDF p32): the HCD writes HeadP/toggleCarry/Halted only while the ED is
halted, skipped or unlinked. Reset Recovery clears both endpoints, which are normally not halted. Lookup
c73480a67748. No runtime failure was observed; #4009 refuses that case conservatively.

Acceptance

  • Each HCD's change is checked against its reference manual and errata.
  • tuh_msc_reset() is validated on hardware for each board family: an idle reset between real commands, then TEST
    UNIT READY and a known-data read without re-enumeration.
  • Each port is removed from the unsupported list in docs/reference/class/msc.rst.

Why deferred

#4009 makes the fenced interface recoverable where the HCD already resets the toggle. Each change here alters
register or toggle state per port and needs its own hardware validation.

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.