This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USB+SD card design consideration

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

Parents
  • > 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

Reply
  • > 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

Children