When TEST UNIT READY, some USB Drives and SD Card Readers respond with sense_key: 0x06, code: 0x28, qualifier: 0x00 NOT READY TO READY TRANSITION - MEDIA CHANGED. In order to clear this code, a REQUEST SENSE needs to be performed before repeating TEST UNIT READY.
If the unit is ready, there is a quick return from the msc_wait_for_ready_state function. The previous code caused a minimum 100ms delay before returning, even if the MSC device was ready.
WAIT_FOR_READY_TIMEOUT_MS was increased to 5000ms, because some USB Drives were timing out with the old value of 3000ms.
Description
Related
Testing
Checklist
Before submitting a Pull Request, please ensure the following:
[x] 🚨 This PR does not introduce breaking changes.
[x] All CI checks (GH Actions) pass.
[x] Documentation is updated as needed.
[x] Tests are updated or added as necessary.
[x] Code is well-commented, especially in complex areas.
[x] Git history is clean — commits are squashed to the minimum necessary.
Fix for espressif/esp-idf issue #14319 USB Host MSC: USB thumb drive cannot be initialized (IDFGH-13412) #14319
When
TEST UNIT READY
, some USB Drives and SD Card Readers respond with sense_key: 0x06, code: 0x28, qualifier: 0x00NOT READY TO READY TRANSITION - MEDIA CHANGED
. In order to clear this code, aREQUEST SENSE
needs to be performed before repeatingTEST UNIT READY
.If the unit is ready, there is a quick return from the
msc_wait_for_ready_state
function. The previous code caused a minimum 100ms delay before returning, even if the MSC device was ready.WAIT_FOR_READY_TIMEOUT_MS
was increased to 5000ms, because some USB Drives were timing out with the old value of 3000ms.Description
Related
Testing
Checklist
Before submitting a Pull Request, please ensure the following:
Closes https://github.com/espressif/esp-idf/issues/14319