![]() |
RA Flexible Software Package Documentation
Release v5.8.0
|
|
Functions | |
fsp_err_t | RM_LITTLEFS_FLASH_Open (rm_littlefs_ctrl_t *const p_ctrl, rm_littlefs_cfg_t const *const p_cfg) |
fsp_err_t | RM_LITTLEFS_FLASH_Close (rm_littlefs_ctrl_t *const p_ctrl) |
Middleware for the LittleFS File System control on RA MCUs.
This module provides the hardware port layer for the LittleFS file system. After initializing this module, refer to the LittleFS documentation to use the file system: https://github.com/ARMmbed/littlefs
Configuration | Options | Default | Description |
---|---|---|---|
Parameter Checking |
| Default (BSP) | If selected code for parameter checking is included in the build. |
Configuration | Options | Default | Description |
---|---|---|---|
Name | Name must be a valid C symbol | g_rm_littlefs0 | Module name. |
Read Size | Must be a non-negative integer | 1 | Minimum size of a block read. All read operations will be a multiple of this value. |
Program Size | Must be a non-negative integer | 4 | Minimum size of a block program. All program operations will be a multiple of this value. |
Block Size (bytes) | Must be a multiple of 64 | 128 | Size of an erasable block. This does not impact RAM consumption and may be larger than the physical erase size. However, non-inlined files take up at minimum one block. Must be a multiple of the read and program sizes. |
Block Count | Manual Entry | (BSP_DATA_FLASH_SIZE_BYTES/128) | Number of erasable blocks on the device. |
Block Cycles | Must be an integer | 1024 | Number of erase cycles before LittleFS evicts metadata logs and moves the metadata to another block. Suggested values are in the range 100-1000, with large values having better performance at the cost of less consistent wear distribution. Set to -1 to disable block-level wear-leveling. |
Cache Size | Must be a non-negative integer | 64 | Size of block caches. Each cache buffers a portion of a block in RAM. The LittleFS needs a read cache, a program cache, and one additional cache per file. Larger caches can improve performance by storing more data and reducing the number of disk accesses. Must be a multiple of the read and program sizes, and a factor of the block size. |
Lookahead Size | Must be a non-negative multiple of 8 | 16 | Size of the lookahead buffer in bytes. A larger lookahead buffer increases the number of blocks found during an allocation pass. The lookahead buffer is stored as a compact bitmap, so each byte of RAM can track 8 blocks. Must be a multiple of 8. |
Configuration | Options | Default | Description |
---|---|---|---|
Custom lfs_util.h | Manual Entry | Add a path to your custom lfs_util.h file. It can be used to override some or all of the configurations defined here, and to define additional configurations. | |
Thread Safe |
| Disabled | Enables thread safety in LittleFS. |
Read Only |
| Disabled | Enables Read Only mode in LittleFS. |
Use Malloc |
| Enabled | Configures the use of malloc by LittleFS. |
Use Assert |
| Enabled | Configures the use of assert by LittleFS. |
Debug Messages |
| Disabled | Configures debug messages. |
Warning Messages |
| Disabled | Configures warning messages. |
Error Messages |
| Disabled | Configures error messages. |
Trace Messages |
| Disabled | Configures trace messages. |
Intrinsics |
| Enabled | Configures intrinsic functions such as __builtin_clz. |
Instance Name for STDIO wrapper | Name must be a valid C symbol | g_rm_littlefs0 | The rm_littlefs instance name to use with the STDIO wrapper. |
The LittleFS port blocks on Read/Write/Erase calls until the operation has completed.
The block size defined in the LittleFS configuration must be a multiple of the data flash erase size of the MCU. It must be greater than 104 bytes which is the minimum block size of a LittleFS block. For information about data flash erase sizes refer to the "Specifications of the code flash memory and data flash memory" table of the "Flash Memory" chapter's "Overview" section.
This is a basic example of LittleFS on Flash in an application.
fsp_err_t RM_LITTLEFS_FLASH_Open | ( | rm_littlefs_ctrl_t *const | p_ctrl, |
rm_littlefs_cfg_t const *const | p_cfg | ||
) |
Opens the driver and initializes lower layer driver.
Implements rm_littlefs_api_t::open().
FSP_SUCCESS | Success. |
FSP_ERR_ASSERTION | An input parameter was invalid. |
FSP_ERR_ALREADY_OPEN | Module is already open. |
FSP_ERR_INVALID_SIZE | The provided block size is invalid. |
FSP_ERR_INVALID_ARGUMENT | Flash BGO mode must be disabled. |
FSP_ERR_INTERNAL | Failed to create the semaphore. |
fsp_err_t RM_LITTLEFS_FLASH_Close | ( | rm_littlefs_ctrl_t *const | p_ctrl | ) |
Closes the lower level driver.
Implements rm_littlefs_api_t::close().
FSP_SUCCESS | Media device closed. |
FSP_ERR_ASSERTION | An input parameter was invalid. |
FSP_ERR_NOT_OPEN | Module not open. |