greiman / UsbFat

Arduino FAT32/FAT16 library for USB drives.
46 stars 14 forks source link

Disconnect and reconnect usb stick #4

Closed fmder closed 8 years ago

fmder commented 8 years ago

I was wondering if it's possible anyhow to disconnect and reconnect the usb stick from the USB Host Shield without restarting the arduino.

I tried putting the initialization in the loop, but I'm unable to open a file after the usb stick is disconnected and reconnected.

greiman commented 8 years ago

Something in the USB_Host_Shield library fails when initialization is done a second time.

I didn't write this library so I don't know why. It may be necessary to call a function in this library to allow removal of the usb stick.

I don't plan future development of UsbFat since the USB_Host_Shield library has marginal USB mass storage support.

didix21 commented 8 years ago

I have done some proves and when I disconnect and recoonet the usb stick the error which I obtain is from bulkonly not from USB class. Then, are you sure that the problem is on USB_Host_Shield ?

greiman commented 8 years ago

The BulkOnly class is in the USB_Host_Shield_2.0 library. You will need to explore this since I didn't write the library.

You should start with a new version of the USB Host shield library since the version included with UsbFat is very old now.