Keil Logo

Using Memory Card Devices

Using Memory Card Device explains the steps to create applications for devices that support the FAT file system. RL-FlashFS supports standard Flash memory cards up to 32 GBytes.

Include into the project and configure the following source files:

  1. The library that matches the device core:
    FS_CM3.lib for Cortex-M devices.
    FS_ARM_L.lib for ARM7 or ARM9 devices.
  2. The corresponding driver file
    MCI_device family.c containing the functions for Flash memory cards.
    SPI_device family.c containing the functions for SPI devices.
  3. The configuration files:
    File_Config.c for configuring the device.
    Retarget.c for configuring the output.
  4. The main file for initializing and connecting the Flash device.
    #include <RTL.h>
    
    int main (void)  {
      ...
      init_card ();                               // initialize the device
    
      while (1)  {
        ...                                       // add the code
        init_card ()                              // check if card removed
        ...                                       // add the code
      }
    }
    
  5. When accessing files located in sub-directories, a complete path must be specified. For example:
    fopen ("logs\\work\\temp.log","r");
    

Applications can be created using existing µVision projects as templates.

  1. Copy all files from any folder \ARM\Boards\vendor\board\RL\FlashFS\SD_File to a new folder and open the project *.uvproj with µVision. RTX projects are using the RTX-RTOS. However, the configuration does not differ.
  2. Open the file File_Config.c and configure the Flash device using the Configuration Wizard.
  3. Enable Memory Card Drive and set the device characteristics.

    Config MCI Drive

  4. File Time Support Routines might need adaptation to set time stamp for the file.
  5. Modify the code to the application needs.

Note

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.