espressif / esp-usb

Other
30 stars 16 forks source link

Fix for /espressif/esp-idf issue #14319 (USB Host MSC: USB thumb drive cannot be initialized [IDFGH-13412]) (IEC-231) #81

Closed fozzzgate closed 4 weeks ago

fozzzgate commented 1 month ago

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: 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:

Closes https://github.com/espressif/esp-idf/issues/14319