Keil Logo

Using FlashFS with USB Devices

Using FlashFS with USB Devices explains the steps to create memory applications for USB devices.

Include into the project and configure the following source files:

  1. The library that matches the device core:
    FS_CM1.lib and USB_CM1.lib for Cortex-M1 devices.
    FS_CM3.lib and USB_CM3.lib for Cortex-M3 devices.
    FS_ARM_L.lib and USB_ARM_L.lib for ARM7 or ARM9 devices.
  2. The hardware driver files:
    usbd_device_family.c from the folder \ARM\RL\USB\Drivers.
    MCI_device_family.c from the folder \ARM\RL\FlashFS\Drivers.
  3. The configuration files:
    usb_config.c from the folder \ARM\RL\USB\Config.
    File_Config.c from the folder \ARM\RL\FlashFS\Config.
  4. usbd_user_msc.c the USB customer code file to adapt the code.
  5. The main file for initializing and connecting the USB Flash device.
    int main (void) {
    
      mc0 = ioc_getcb (NULL);                   /* Get handle for FAT media controller */
      if (ioc_init (mc0) == 0) {                /* Initialize FAT media device */
        ioc_read_info (&info, mc0);             /* Read FAT media configuration */
        usbd_init();                            /* USB Device Initialization */
        usbd_connect(__TRUE);                   /* USB Device Connect */
      }
    
      while (1);                                /* Loop forever */
    }
    

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

  1. Copy all files from any folder \ARM\Boards\vendor\board\RL\USB\Device\Memory_FlashFS\SD_Memory 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. Follow the steps described in Create MSC Applications to configure the USB part.
  3. Follow the steps described in Using Memory Card Devices to configure the Flash File System.
  4. Adapt the code for the FAT Driver.
  5. Modify the code to the application needs.
  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.