You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Discovered this when running a usbpsu example and running an ancient version of "uvcview.exe" (6.1.7600.16385).
When running "uvcview.exe" (6.1.7600.16385) the example device enters a bad state and the device cannot be used until restarted.
When running a more recent "usbview.exe" (10.0.17134.1) the USB descriptors are displayed correctly.
The old "uvcview" appears to enumerate over string descriptors 0-31 regardless of what string descriptor indexes are referenced in other descriptors.
The new "usbview" appears to only request string descriptors that are actually referenced in other descriptors.
I believe the issue is that some of the Xilinx USB drivers don't stall on unsupported/invalid standard descriptor requests when they should.
To attempt to verify this I implemented a small local patch to stall when the host requests an invalid string descriptor id and this appears to have resolved the issue.
The USB spec
If an unsupported or invalid request is made to a device, the device responds by returning a
STALL Transaction Packet
[Universal Serial Bus 3.2 Specification, Section 9.4, page 332]
Affected drivers
Note: I have only ran the usbpsu driver on hardware but suspect the issue is also present in the usbps driver.
usb
usbps
usbpsu
Stalls?
Yes
No
No
The infrastructure for stalling appears to already be present in usbps and usbpsu, but is not active for all standard descriptors.
Expected Behavior
If an unsupported or invalid request is made to a device, the device responds by stalling EP0.
Background
Discovered this when running a usbpsu example and running an ancient version of "uvcview.exe" (6.1.7600.16385).
When running "uvcview.exe" (6.1.7600.16385) the example device enters a bad state and the device cannot be used until restarted.
When running a more recent "usbview.exe" (10.0.17134.1) the USB descriptors are displayed correctly.
The old "uvcview" appears to enumerate over string descriptors 0-31 regardless of what string descriptor indexes are referenced in other descriptors.
The new "usbview" appears to only request string descriptors that are actually referenced in other descriptors.
I believe the issue is that some of the Xilinx USB drivers don't stall on unsupported/invalid standard descriptor requests when they should.
To attempt to verify this I implemented a small local patch to stall when the host requests an invalid string descriptor id and this appears to have resolved the issue.
The USB spec
Affected drivers
Note: I have only ran the usbpsu driver on hardware but suspect the issue is also present in the usbps driver.
The infrastructure for stalling appears to already be present in usbps and usbpsu, but is not active for all standard descriptors.
Expected Behavior
If an unsupported or invalid request is made to a device, the device responds by stalling EP0.
Actual Behavior
In usbpsu, if an unsupported or invalid string descriptor request is made to a device, the device responds by sending a packet of length 0:
https://github.com/Xilinx/embeddedsw/blob/5688620af40994a0012ef5db3c873e1de3f20e9f/XilinxProcessorIPLib/drivers/usbpsu/examples/xusb_ch9.c#L292C1-L305C31
Steps to Reproduce
The text was updated successfully, but these errors were encountered: