 | RL-ARM User's Guide |  |
|
|
| Using FlashFS with USB DevicesUsing FlashFS with USB Devices explains the steps to create memory applications for USB devices. Include into the project and configure the following source files: - 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. - 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. - The configuration files:
usb_config.c from the folder \ARM\RL\USB\Config. File_Config.c from the folder \ARM\RL\FlashFS\Config. - usbd_user_msc.c the USB customer code file to adapt the code.
- 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. - 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.
- Follow the steps described in Create MSC Applications to configure the USB part.
- Follow the steps described in Using Memory Card Devices to configure the Flash File System.
- Adapt the code for the FAT Driver.
- Modify the code to the application needs.
|
|