Keil Logo

Migrate FlashFS Projects

This section describes the migration of Flash File System applications built with RL-ARM to be used with MDK-Professional. Make the following changes to the project:

Include the library

Include the library from the folder \ARM\RV31\Lib.

  • FS_ARM_L.lib for ARM7 and ARM9 devices.
  • FS_CM3.lib for Cortex-M devices.

Replace the configuration file

  1. Rename the original File_Config.c to File_Config_old.c.
  2. Copy File_Config.c from the folder \ARM\RL\FlashFS\Config to the project folder.
  3. Open both files, File_Config.c and File_Config_old.c, with the µVision Configuration Wizard.
  4. Transpose the option settings to File_Config.c. For new options refer to the section Configuration Options of RL-FlashFS.

Replace SD/MMC drivers

  1. Delete the original MCI_device_family, SDIO_device_family, or SPI_device_family driver files.
  2. Copy the new MCI_device_family, SDIO_device_family, or SPI_device_family driver files from the folder \ARM\RL\FlashFS\Drivers.
  3. Update the driver instance definition. The first driver instance is mci0_drv.
    #define  __DRV_ID  mci0_drv           // First instance definition of the mci driver
    #define  __DRV_ID  mci1_drv           // Second instance definition of the mci driver
  4. Update the clock definitions to reflect the real clock settings.
    #define  __MCLK    48000000
    #define  __CPUCLK  48000000
  5. Modify the function CheckMedia of the SD Card driver. If the CD (CardDetect) and WP (WriteProtect) digital inputs are connected, then change the code to check the signals from the SD Card socket.
    static U32 CheckMedia (void)  {       // Read CardDetect and WriteProtect card socket pins
    U32 stat = 0;
      if (!(FIO0PIN & 0x04))  {           // Card is inserted (CD=0)
        stat |= M_INSERTED;
      if ((FIO0PIN & 0x20))  {            // Write Protect switch is active (WP=1)
        stat |= M_PROTECTED;
      return (stat);
  6. The function returns M_INSERTED, if the signals are not connected.
    static U32 CheckMedia (void)  {       // CardDetect and WriteProtect pins not connected
      return (M_INSERTED);

Replace Flash programming algorithms

  1. Delete the original file FS_FlashPrg.c or FS_SPI_FlashPrg.c.
  2. Copy the new Flash programming algorithm file FS_FlashPrg.c or FS_SPI_FlashPrg.c from the folder \ARM\RL\FlashFS\Flash\device_family.
  3. Update the SPI driver instance definition (for SD Card in SPI mode). The first SPI driver instance is spi0_drv.
    #define __SPI spi0_drv                // Default and first SPI driver instance definition
    #define __SPI spi1_drv                // Second SPI driver instance definition

Update the code

  1. Replace the function call finit() with finit (NULL).
    finit (NULL);                         // Before:  finit();


  • Make a backup copy of the original project.
  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.