Skip to end of metadata
Go to start of metadata

The Micrium OS File System is configurable at compile time through a set of #defines located in fs_core_cfg.h and fs_storage_cfg.h. Through these #defines, the Micrium OS File System feature set can be tailored to match your application's requirements while keeping ROM and RAM footprints as low as possible.

We recommend that you begin the configuration process with the default configuration values, which are shown in bold in the next sections.

The sections below are organized following the order in Micrium OS File System template configuration files, fs_core_cfg.h and fs_storage_cfg.h.

Core Configuration

The Core layer options are found in the file fs_core_cfg.h.

Generic Options

ConstantDescriptionPossible values
FS_CORE_CFG_FAT_EN

Enables or disables support for the FAT file system driver.

Since FAT is the only file system driver currently supported, this option must be enabled.
DEF_ENABLED or DEF_DISABLED
FS_CORE_CFG_POSIX_ENEnables or disables support for the POSIX compatibility layer.DEF_ENABLED or DEF_DISABLED
FS_CORE_CFG_DIR_ENEnables or disables support for directories. If this option is disabled, only files residing in a volume's root directory can be accessed. Furthermore, no entries can be created outside of a volume's root directory. All code paths dealing with directories are thus excluded.DEF_ENABLED or DEF_DISABLED
FS_CORE_CFG_FILE_BUF_EN

Enables or disables support for file buffers. Disabling this option removes all code paths and data structures related to file buffers handling.

This option must be enabled when FS_CORE_CFG_POSIX_EN is enabled.
DEF_ENABLED or DEF_DISABLED
FS_CORE_CFG_FILE_LOCK_EN

Enables or disables support for file locks.

DEF_ENABLED or DEF_DISABLED
FS_CORE_CFG_PARTITION_EN

Enables or disables support for partitions. If this option is disabled, only the first partition can be accessed and partition table creation in the Master Boot Record (MBR) is disabled.

DEF_ENABLED or DEF_DISABLED
FS_CORE_CFG_TASK_WORKING_DIR_EN

Enables or disables support for task bound working directories.

This feature can be enabled only if the kernel abstraction layer implementation (KAL) being used provides task registers (see the subsection Task Registers in the Task Management Kernel Services section).
DEF_ENABLED or DEF_DISABLED
FS_CORE_CFG_UTF8_ENEnables or disables support for entry names containing UTF-8 characters. If this option is disabled, only ASCII characters may be used in an entry name.DEF_ENABLED or DEF_DISABLED
FS_CORE_CFG_THREAD_SAFETY_EN

Enables or disables thread safety at the core level. When disabled, this option may result in improved CPU time, RAM and ROM usage.

It is not safe to disable this option when the file system is accessed by concurrent tasks. When in doubt, leave this option to its default value (DEF_ENABLED).
DEF_ENABLED or DEF_DISABLED
FS_CORE_CFG_ORDERED_WR_EN

Enables or disables ordered write operations. If this option is enabled, write operations will be performed on the underlying media in a known order (typically one that does not jeopardize file system integrity in case of an untimely power failure). This option can be safely disabled when caches being used have only one block.

It is not safe to disable this option when at least one cache instance has more than one block. When in doubt, leave this option to its default value (DEF_ENABLED).
DEF_ENABLED or DEF_DISABLED
FS_CORE_CFG_FILE_COPY_ENEnables or disables file copy. If this option is enabled, a dedicated API is provided for copying files. While it is possible to perform a copy using File System Compile-Time Configuration and File System Compile-Time Configuration API functions, this approach requires more RAM: one buffer for reading / writing and at least one cache block, as opposed to only one cache block in the case of File System Compile-Time Configuration.DEF_ENABLED or DEF_DISABLED
FS_CORE_CFG_RD_ONLY_ENEnables or disables the read-only mode. If this option is enabled, all write operations are disallowed, and all the associated code paths and data structures are excluded.DEF_ENABLED or DEF_DISABLED
FS_CORE_CFG_POSIX_PUTCHARConfigures the putchar()-like callback that is used internally by the perror() function to output an error message. The provided function must have the following prototype: int my_putchar_func(int c). If FS_CORE_CFG_POSIX_PUTCHAR is not defined, the perror() function will not be available.Any putchar()-like function (default is putchar)
FS_CORE_CFG_MAX_VOL_NAME_LENConfigures the maximum number of characters contained in a volume name (e.g., the name given to File System Compile-Time Configuration) not including the terminating null character.Must be > 1 (default is 20)
FS_CORE_CFG_DBG_MEM_CLR_ENEnables or disables the memory clear debug feature.DEF_ENABLED or DEF_DISABLED
FS_CORE_CFG_CTR_STAT_EN

Enables or disables core statistics counters.

DEF_ENABLED or DEF_DISABLED
FS_CORE_CFG_CTR_ERR_EN

Enables or disables core error counters.

DEF_ENABLED or DEF_DISABLED
Figure - Generic Options

FAT-Specific Options

ConstantDescriptionPossible values
FS_FAT_CFG_LFN_ENEnables or disables the long file name support. If this option is disabled, LFN entries cannot be accessed nor created.DEF_ENABLED or DEF_DISABLED
FS_FAT_CFG_FAT12_ENEnables or disables the FAT12 file system driver.DEF_ENABLED or DEF_DISABLED
FS_FAT_CFG_FAT16_ENEnables or disables the FAT16 file system driver.DEF_ENABLED or DEF_DISABLED
FS_FAT_CFG_FAT32_ENEnables or disables the FAT32 file system driver.DEF_ENABLED or DEF_DISABLED
FS_FAT_CFG_JOURNAL_ENEnables or disables the FAT journaling module.DEF_ENABLED or DEF_DISABLED
Table - FAT-Specific Options

Storage Configuration

The Storage layer options are found in the file fs_storage_cfg.h.

Generic Options

ConstantDescriptionPossible values
FS_STORAGE_CFG_DBG_WR_VERIFY_ENEnables or disables the written data check. If this option is enabled, a write access to the media is verified by reading back the written data intergrity by performing a CRC check.DEF_ENABLED or DEF_DISABLED
FS_STORAGE_CFG_CTR_STAT_ENEnables or disables storage statistics counters.DEF_ENABLED or DEF_DISABLED
FS_STORAGE_CFG_CTR_ERR_ENEnables or disables storage error counters.DEF_ENABLED or DEF_DISABLED
FS_STORAGE_CFG_MEDIA_POLL_TASK_ENEnables or disables media polling task.DEF_ENABLED or DEF_DISABLED
FS_STORAGE_CFG_RD_ONLY_ENEnables or disables the read-only mode. If this option is enabled, all write operations are disallowed, and all the associated code paths and data structures are excluded.DEF_ENABLED or DEF_DISABLED
FS_STORAGE_CFG_CRC_OPTIMIZE_ASM_ENEnables or disables CRC calculation assembler optimization.DEF_ENABLED or DEF_DISABLED
Table - Generic Options

NAND-Specific Options

ConstantDescriptionPossible values
FS_NAND_CFG_AUTO_SYNC_EN

Determines, for each operation on the device (i.e., each call to the device's API), if the metadata should be synchronized. Synchronizing at the end of each operation is safer; it ensures the device can be remounted and appear exactly as it should. Disabling automatic synchronization will result in a large write speed increase, as the metadata won't be committed automatically, unless done in the application. If a power down occurs between a device operation and a sync operation, the device will appear as it was in a prior state when remounted. Device synchronization can be forced with a call to FSBlkDev_Sync().

Note that using large write buffers will reduce themetadatasynchronization performance hit, as fewer calls to the device API will be needed.
DEF_ENABLED or DEF_DISABLED
FS_NAND_CFG_UB_META_CACHE_EN

Determines, for each update block, if the metadata will be cached. Enabling this will allow searching for a specific updated sector through data in RAM instead of accessing the device, which would require additional read page operations.

More RAM will be consumed if this option is enabled, but write/read speed will be improved.

RAM usage = (<Nbr update blks> x (log2(<Max associativity>) + log2(<Nbr secs per blk>)) / 8) octets (rounded up).

DEF_ENABLED or DEF_DISABLED
FS_NAND_CFG_DIRTY_MAP_CACHE_EN

Determines if the dirty blocks map will be cached. With this feature enabled, a copy of the dirty blocks map on the device is cached. It is possible then to determine if the state "dirty" of a block is commited on the device without the need to actually read the device.

With this feature enabled, overall write and read speed should be improved. Also, robustness will be improved for specific cases. However, more RAM will be consumed.
RAM usage = (<Nbr of blks on device> / 8) octets (rounded up)
DEF_ENABLED or DEF_DISABLED
FS_NAND_CFG_UB_TBL_SUBSET_SIZE

Controls the size of the subsets of sectors pointed by each entry of the update block tables. The value must be a power of 2 (or 0).

If, for example, the value is 4, each time a specific updated sector is requested, the NAND Flash Translation layer must find the sector from a group of 4 sectors. Thus, if the cache is disabled, 4 sectors must be read from the device. Otherwise, the 4 entries will be searched in the cache. If the value is set to 0, the table will be disabled completely, meaning that all sectors of the block might have to be be read before the specified sector is found. If the value is 1, the table completely specifies the location of the sector, and thus no search must be performed. In that case, enabling the update blocks metadata cache will yield to no performance benefit.

RAM usage = (<Nbr update blks> x (log2(Nbr secs per blk>) - log2(<Subset size>) x <Max associativity> / 8) octets (rounded up).

Any power of 2 or 0 (default is 1)
FS_NAND_CFG_RSVD_AVAIL_BLK_CNT

Indicates the number of blocks in the available blocks table that are reserved for metadata block folding. Since this operation is critical and must be done before adding blocks to the available blocks table, the driver needs enough reserved blocks to make sure at least one of them is not bad so that the metadata can be folded successfully. When set to 3, probability for the metadata folding operation to fail is low. This value should be sufficient for most applications.

Must be > 1 (default is 3)
FS_NAND_CFG_MAX_RD_RETRIES

Indicates the maximum number of retries performed when a read operation fails. It is recommended by most manufacturers to retry reading a page if it fails, as successive read operations might be successful. This number should be at least set to 2 for smooth operation, but might be set higher to improve reliability.

Must be > 2 (default is 10)
FS_NAND_CFG_MAX_SUB_PCT

Indicates the maximum number of update blocks that can be sequential update blocks (SUB). This value is set as a percentage of the total number of update blocks.

Integer between 0 and 100 (default is 30)
FS_NAND_CFG_DUMP_SUPPORT_ENEnables or disables support for the NAND dump facility.DEF_ENABLED or DEF_DISABLED
Figure - NAND-Specific Options

NOR-Specific Options

ConstantDescriptionPossible values
FS_NOR_CFG_WR_CHK_EN

Enables or disables checking for data writes. When enabled, all NOR operations implying a write operation such as page program or block erase are verified by reading back the data from the NOR chip and comparing it to the data written. When erasing a block, the check ensures that the read data bits are all one because after an erase operation, the bits are all set to one. This configuration is useful during the development phase and should not be left enabled as it impacts the write performances.

DEF_ENABLED or DEF_DISABLED
Table - NOR-Specific Options

SD-Specific Options

ConstantDescriptionPossible values
FS_SD_SPI_CFG_CRC_EN

Enables or disables CRC and checking for data writes and reads. When enabled, a CRC will be generated for data written to the card, and the CRC of received data will be checked. When disabled, no CRC will be generated for data written to the card, and the CRC received data will not be checked.

DEF_ENABLED or DEF_DISABLED
Table - SD-Specific Options

  • No labels