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

RTX USB MSC with MMC interface of FlashFS

This is a general question:

Has anybody successfully implemented the RTX USB MSC together with the MMC interface of FlashFS on an LPC2148 having a microSD card connected to SPI1 ?

I used \Keil\ARM\Boards\Keil\MCB2300\RL\USB_FlashFS\SD_File as a starting point.

SPI data rates are 400 kBit/s and 15 MBit/s (LPC2148 operated @60 MHz).

MicroSD card access via FlashFS itself works fine. Also USB MSC enumerates correctly (windows recognizes the device and shows it as drive).

But accessing the drive in Windows leads to erroneous behavior varying from XP to 7.

Are there general performance issues with the above architecture?

I would realy appreciate some hints from the USB / RTX Guru ...

Thank you very much in advance.

Oliver

Parents
  • The setup of MSC_BlockCount in the Keil example is based on a fixed block size of 512.

    This appears to be correct for SD cards up to 1GB.

    As stated in the SD card spec, particularly for a 2GB card, the value returned in mmcfg.blocknr can be related to other block sizes as reported by mmcfg.read_blen .

    Since the mmc_init() sets the block size actually used to 512 bytes, MSC-BlockCount has to be calculated as shown in my example:

    void checkMicroSdCard(void)
    {
      MMCFG mmcfg;
      if (mmc_init())
      {
        mmc_read_config(&mmcfg);
        MSC_BlockCount = mmcfg.blocknr * ( mmcfg.read_blen >> 9 );
        ...
      }
    }
    

    Now the correct capacity is shown in the Windows format dialog.

Reply
  • The setup of MSC_BlockCount in the Keil example is based on a fixed block size of 512.

    This appears to be correct for SD cards up to 1GB.

    As stated in the SD card spec, particularly for a 2GB card, the value returned in mmcfg.blocknr can be related to other block sizes as reported by mmcfg.read_blen .

    Since the mmc_init() sets the block size actually used to 512 bytes, MSC-BlockCount has to be calculated as shown in my example:

    void checkMicroSdCard(void)
    {
      MMCFG mmcfg;
      if (mmc_init())
      {
        mmc_read_config(&mmcfg);
        MSC_BlockCount = mmcfg.blocknr * ( mmcfg.read_blen >> 9 );
        ...
      }
    }
    

    Now the correct capacity is shown in the Windows format dialog.

Children
No data