host: local data toggle reset unsupported on rp2040, pio-usb, WCH USBFS, MAX3421E, RUSB2 and non-halted OHCI EDs
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- c
- Domain
- backend-api-design, embedded-iot
Research direction
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.
Written by the indexing model from the issue text.
Description
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. Lookups5c099c15f415,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.
- 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