Open Ryzee119 opened 2 weeks ago
this is interesting, I overlook the specs on this. Blindly wait for 2 seconds isn't good though, would your device still response after a few seconds after stalled response ? I am thinking we can allow the control transfer to retry up to 3 seconds right after SET_ADDRESS e.g. increase the delay to 1000 ms if the first descritptor isn't retrieved after addressed https://github.com/hathach/tinyusb/blob/master/src/host/usbh.c#L1314 ?
It is 2 milliseconds, not seconds so not too bad to wait on I don't think.
Your retry mechanism is good and it does recover from it 😊
ah sorry, indeed, I overlook it again, indeed 2 ms is OK :) . I think We can safely add that delay since it is part of the specs.
Operating System
Windows 11
Board
N/A
Firmware
N/A
What happened ?
Ref USB Spec 9.2.6.3
I have a device (HID game controller) that will STALL on the first request after the set address command is issued without this delay.
The enumeration is a bit of a complex state machine so didnt know the best way to include it. I just did this
How to reproduce ?
Very dependant on your USB device. But I just plugged it in and got STALL error on first command after the set address.
Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)
N/A
Screenshots
No response
I have checked existing issues, dicussion and documentation