Question
Force OS to re-enumerate mass storage device
Posted on November 20, 2013 at 11:22
Dear all,
I am developing a mass storage device usinghttp://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/DM00037051.pdf
. The number of drives must change dynamically based on a certain event (e.g., a new drive mush show up after pushing a button on the board). I could accomplish this if I could force windows to issue
http://en.wikipedia.org/wiki/SCSI_Report_LUNs_Command
command again (it is a SCSI command that retrieves the number of logical units on the device). But so far I have had no success.
My current solution is to detach/attach the usb interface using OTG_FS_DCTL register but it causes all volumes to disappear at first and then reappear again. I was wondering if it would be possible to force the operating system to re-enumerate usb devices on the bus without restarting the interface.Regards,Mostafa