Keil™, An ARM® Company

RL-ARM User's Guide

Memory Card Device

RL-FlashFS can use SPI mode or SD/MMC native mode to initialize and control the memory card drive.

  • SPI mode - the required routines are in the low level SPI driver. It handles data transfer on the SPI interface. In SPI mode the memory card control is handled in software.
  • Native mode - can be used if a device has integrated a Multimedia Card Interface peripheral. The required routines are in the low level MCI driver module. Native mode is faster then SPI mode because the memory card control is handled in hardware.

The SPI driver or Native mode driver is not included in the RL-FlashFS library because it is device dependent. Hence, you must copy the driver to your project folder and include it into your project.

To configure a memory card drive, you have the following configuration options:

  • MC_DEV enables support for SD and MMC flash memory card devices. When this option is set to 1, MC drive is enabled, and you can use it. When this option is set to 0, MC drive is disabled.
    #define MC_DEV     0
    
  • MC_CSIZE enables or disables the data Cache and specifies the Cache Buffer size. When SD/MMC Memory Card is controlled in Native mode, data caching might increase the file r/w speed several times. In SPI mode the benefit is not so high. When Caching is enabled, Flash File System uses Multiple Sector Read and Multiple Sector Write commands to control the SD/MMC memory card data read and write.
    #define MC_CSIZE   8
    

     

    • You might turn off the data cache if your application is low on memory and the file read/write speed is not so important.
  • MC_RELOC enables Cache Buffer relocation. This is required for LPC23xx/LPC24xx devices from NXP. When this option is set to 1, relocating of the Cache Buffer is enabled. When this option is set to 0, Cache Buffer is allocated inside default RAM section of your project.
    #define MC_RELOC   0
    
  • MC_CADR specifies the location address for the Cache Buffer. This option is active only when the MC_RELOC is enabled. Default value is selected for LPC23xx/LPC24xx devices from NXP.
    #define MC_CADR    0x7FD00000