2015-04-10 04:56 AM
I'm developing code for custom STM32F103-based board. I'm using code from USB Mass Storage demo from STM32_USB-FS-Device_Driver library 4.0.0 (yes, it may look pretty old, but it works), storage media is SPI flash chip. After successful implementation of simple caching algorithm, write speed raised to ~65kB/s, read speed is limited by USB FS itself, this is very good result for me.
Now I need some information about how to control future filesystem consistency - I mean, how do I STOP USB MSC from functioning and re-start it again when needed? Is there specific API for it, or some SCSI command needs to be implemented or I can just turn off USB peripheral? And I need to ''catch'' moment of initialization, when device is successfully enumerated and recognized, just to prevent possible conflicts and filesystem corruption from actions of internal software. I don't want to change this particular library to something else, but some ''patchworking'' is fine. Just to clarify situation: ''unplug the connector'' is not a solution here, because I want to have working HID to control this device, I need just to stop MSC part. #stm32-usb-msc2015-04-11 04:51 AM
Have it report that it's a removable media device, and use the sense mechanism return Not Ready, or No Media Present type responses.