2014-06-18 6:01 AM
Dear All,
I am implementing a solution where I have to read file when device is in usb mass storage mode and after reading I have to delete the file. I have implemented USB Mass Storage device based on STM32F105 and I am using emfile - emb OS from segger. When device in MSC, I am stuck at SD_Readbyte flag. My doubts are : 1. Is USB blocking access to SD Card/SPI lock? 2. At what point I should be able to access the SD Card? - After completion of USB MSC Initialization? Please revert ASAP. Thanking you in anticipation. Best Regards, hgaurav2014-06-18 8:06 AM
You have to disconnect the USB, or have it present that the media is ejected, changed, not present, and/or not ready. If you don't do this the contention/coherency issues are practically impossible to overcome, as you don't control enough of the software in the system.
2014-06-24 12:35 AM
2014-06-24 7:10 AM
The card reader will basically take the read, write, control functions passed as MSC/SCSI commands, and turn them into card access commands. It does this at a sector/block level.
If you have code on the STM32 that you want to access the card and files on it, you need an access layer/driver, and a file system, like FatFs. What is very difficult to do is allow a PC and STM32 access the card at the same time, you are likely to corrupt the content of the card as you have different views on what is current.We’re moving the ST Community to a new platform to give you a better and more reliable community experience.