![]() |
File System Component
Version 8.0.2
MDK Middleware for Devices with Flash File System
|
|
The steps to create a microcontroller application that uses the File System are:
Only a few steps are necessary to complete the RTE Component selection:
The section Drives, Memory Devices and Drivers shows the relationship between drive - memory device - and driver/interface.
For using a NOR Flash drive, a Flash (API) driver is required, which encapsulates either the Memory Bus interface or SPI (in which case an SPI (API) driver is required in addition):
If your NOR Flash device is not listed, use one of the examples as a reference to implement a driver for your specific device:
Configure the driver-hardware relationship using the FS_Config_NOR_n.h
file:
To enable a RAM disk drive, select File System:Drive:RAM.
Set the drive characteristics in the FS_Config_RAM.
h file:
Memory cards can be connected to a microcontroller device either using an SD/MMC bus mode (MCI) or an SPI bus mode:
Set the drive characteristics in the FS_Config_MC_n.h
file:
Note
- If your microcontroller device does not have a CMSIS-Driver for the MCI (API) or SPI (API), you can try to develop your own one based on the CMSIS-Driver Reference documentation.
- The page Memory Card Control Layer lists all supported memory card types and gives further details on how to use these cards.
- General System Resource Configuration requirements apply.
Set the drive characteristics in the FS_Config_USB_n.h
file:
Note
- If your microcontroller device does not have a CMSIS-Driver for the USB Host (API), you can try to develop your own one based on the CMSIS-Driver Reference documentation.
- General System Resource Configuration requirements apply.
Set the drive characteristics in the FS_Config_NAND_n.h
file:
Note
- If your microcontroller device does not have a CMSIS-Driver for the NAND (API), you can try to develop your own one based on the CMSIS-Driver Reference documentation.
- The page NAND Flash Translation Layer describes additional features specific to these devices.
- Using a NAND (API) driver, you can use any NAND Flash device with an 8-/16-bit memory bus interface for data storage.
- NAND Flashes with SPI interface (Serial NAND) are currently not supported by the File System Component.
- General System Resource Configuration requirements apply.
The File System configuration file FS_Config.h
contains settings for the amount of files that can be open at the same time:
Maximum number of simultaneously opened files can be set separately for FAT File System and for Embedded File System (EFS).
As the file system is not bound to a special type of hardware, you need to configure the necessary drivers according to the requirements of your target device. This configuration is done in the RTE_Device.h
configuration file:
For proper operation, the File System Component requires some system configuration settings. The requirements are:
startup_device.s
file (Heap_Size
) or linker script
.For more information, check the File System component's Resource Requirements section.
All available functions are documented in the Reference section of the File System Component. These routines can be adapted to the needs of the microcontroller application, in case more functionality is needed.
File System Component can be easily configured to generate debug events and provide dynamic visibility to the component operation.
File System supports event annotations for the Event Recorder and make it very easy to analyze the internal operation of the File System Component during application debug. The Debug Events describes the events implemented in the File System Component.
Event Recorder is a powerful tool that provides visibility to the dynamic execution of the program.
The File System Component generates a broad set of Debug Events for the Event Recorder and implements required infrastructure to interface with it.
To use the Event Recorder it is required to create an image with event generation support. The necessary steps are:
FS_Debug.h
enable File System event generation and configure event filters.Now, when the File System generates event information, it can be viewed in the Event Recorder Window.
This section describes the configuration settings for the Event Recorder.
File System Event Generation Configuration
Selecting the File System:CORE will add the file FS_Debug.h
to your project. Use this file to set the event generation configuration for File System core and drivers separately.
The following settings are available for event generation configuration of each module:
The file system component uses the following event IDs:
Component | Event ID |
---|---|
FsCore | 0x80 |
FsFAT | 0x81 |
FsEFS | 0x82 |
FsIOC | 0x83 |
FsNFTL | 0x84 |
FsNAND | 0x85 |
FsMcMCI | 0x86 |
FsMcSPI | 0x87 |