AnsweredAssumed Answered

USB Mass Storage vs Internal Filesystem

Question asked by Eugene Solo on Apr 10, 2015
Latest reply on Apr 11, 2015 by Clive One
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.

Outcomes