chegewara / EspTinyUSB

ESP32S2 native USB library. Implemented few common classes, like MIDI, CDC, HID or DFU (update).
MIT License
475 stars 70 forks source link

Does the MSC support Hot plugging? #73

Open starr3333 opened 2 years ago

starr3333 commented 2 years ago

First of all, thank you for your work, EspTinyUSB is a great library!

When I try the MSC example, I found that the current MSC example program doesn't seem to support hot-plugging.

According to my test, when hot-plugging the disk, the usb_host_transfer_submit() function in USBmscDevice::csw() will return the status of ESP_ERR_INVALID_STATE. And then the program will lose the usb_host communication.

Is there any solution?

chegewara commented 2 years ago

Sorry, it is not supported yet. Its because of bugs in esp-idf host code, which is already fixed in master, but im not sure if its backported to v4.4 and arduino-esp32.

gary7530 commented 1 year ago

https://github.com/chegewara/EspTinyUSB/blob/master/examples/host/msc/msc.ino How can the functionality of USB hot-plugging be implemented in the example of host msc ?