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
usbus/msc has several design issues regarding its error handling, especially if something turns wrong during a mtd read or write. If an error occurs during a read operation, the IN endpoint will be stalled to indicate that something went wrong to the host, then the host should clear the stall and device must generate a CSW block to end the current transaction.
Nevertheless, the current behavior is wrong and CSW is never generate, which cause issues.
Currently there is no way to fix this issue, as usbus doesn't tell the interface that the endpoint stall condition has been cleared, thus we cannot generate the CBW block since we don't know when the bulk IN endpoint will be available to transfer new data.
Moreover, there is another issue regarding the USB reset. If host tries to perform an USB reset, the current MSC implementation will not work anymore after that. This is because the MSC Bulk OUT endpoint not being set as ready by the MSC after the reset.
Some work are being done to fix these issues but API changes are required (in USBUS) to be done first.
Expected results
MSC should work reliably and should be able to recover properly from an USB reset without having to reset the board.
Actual results
If an error occurs during a read or write operations, the MSC implementation will misbehaves on its bulk IN endpoint and won't work anymore after the USB reset. Only a board reset will allow to recover.
Versions
Current RIOT master
Thanks @gschorcht for shedding some light on these issues.
The text was updated successfully, but these errors were encountered:
Description
usbus/msc
has several design issues regarding its error handling, especially if something turns wrong during a mtd read or write. If an error occurs during a read operation, the IN endpoint will be stalled to indicate that something went wrong to the host, then the host should clear the stall and device must generate a CSW block to end the current transaction.Nevertheless, the current behavior is wrong and CSW is never generate, which cause issues.
Currently there is no way to fix this issue, as usbus doesn't tell the interface that the endpoint stall condition has been cleared, thus we cannot generate the CBW block since we don't know when the bulk IN endpoint will be available to transfer new data.
Moreover, there is another issue regarding the USB reset. If host tries to perform an USB reset, the current MSC implementation will not work anymore after that. This is because the MSC Bulk OUT endpoint not being set as ready by the MSC after the reset.
Some work are being done to fix these issues but API changes are required (in USBUS) to be done first.
Expected results
MSC should work reliably and should be able to recover properly from an USB reset without having to reset the board.
Actual results
If an error occurs during a read or write operations, the MSC implementation will misbehaves on its bulk IN endpoint and won't work anymore after the USB reset. Only a board reset will allow to recover.
Versions
Current RIOT master
Thanks @gschorcht for shedding some light on these issues.
The text was updated successfully, but these errors were encountered: