Hello,
I am new to the keil USB and SD card, our system requires to use SD card in application, and need to be connected to pc, on pc, user should be able to see the SD card files, I have some questions:
In the example "C:\Keil\ARM\Boards\Keil\MCB2300\RL\USB\Device\Memory_FlashFS\SD_File" SD card is either mounted to pc as a USB disk, either used by the target's serial port, could it be possible to make them working at the same time?
I also noticed many mobile phones, when connected to pc, it asks user to select a mode: USB disk or Sync, if you select USB disk mode, you see the disk on pc, but you can not see the storage card within the phone, if you select the Sync mode, there is no USB disk appeared on pc, this give me the feeling that SD card can not be mounted to pc and used by phone at the same time??
Back to the keil example, I think the FlashFS's API (fopen/fclose) is in high level, while the usbd_user_msc.c uses ioc_read_sector functions, in the low level? they are operating in different levels?
If they can not work at the same time, what's the consideration?
Thanks
> could it be possible to make them working at the same time?
No. It may messe up file system on the SD card.
While PC mounts the SD card over USB MSC (Mass Storage Class), PC File Manager occupies the SD card. It has caches of the SD sectors on the PC side. If your firmware would rewrite the SD sectors without any command from PC, PC caches wouldn't match to the real ones. As the result, PC File Manager get confused.
The SD card is exclusively occupied by PC or your firmware process.
> I think the FlashFS's API (fopen/fclose) is in high level, while the usbd_user_msc.c uses ioc_read_sector functions, in the low level? they are operating in different levels?
These functions belong to different systems, which work exclusively.
Tsuneo
"While PC mounts the SD card over USB MSC (Mass Storage Class), PC File Manager occupies the SD card. It has caches of the SD sectors on the PC side."
This is the reason for the extra cost for external hard disks with Ethernet interface compared to an USB interface. With the USB interface, the disk is "dumb" and the PC owns it and decides what changes to make. With the Ethernet interface, the disk must contain a full file server to arbitrate between different clients that connects to the disk.
Just as you have already noted, lot's of cameras, phones etc can export the memory card through the USB interface, but make use of some menu setting to control if the device should export the memory card, or if the USB interface is just for control/networking/... but the camera/phone owns the memory card.
Hi Tsuneo and Per, Thanks for your answer.