This library provides implemented drivers for the littlefs file system. Typically, drivers are based on the HAL driver or other high-level middleware such as serial-memory.
This middleware:
The Quick Start Guide section has simple examples for the SPI flash and SD Card drivers. Examples are used to initialize the file system on the target memory, demonstrate the creation/opening file, and update its content.
All HW resources used in this QSG must be configured in the Device Configurator:
If a different alias name is selected, instead of expected resources name in the Device Configurator, the code snippets must be updated.
Resource | Name |
---|---|
Quad Serial Memory Interface | SMIF_LITTLEFS |
SD Host Controller | SDHC_LITTLEFS |
Serial Communication Block (for debug UART) | DEBUG_UART |
Pin | CYBSP_USER_BTN |
Recommended SD Card configuration
Recommended SMIF configuration
Recommended Debug UART
Recommended Button Pin configuration
Specific steps for SPI flash driver configuration
Specific steps for the SD Card driver configuration
Common code
retarget-io configuration
The driver configuration details are described in the relevant section:
SOURCES
and INCLUDES
variables in the Makefile.FREERTOS
to the components list when using FreeRTOS.DEFINES=LFS_THREADSAFE
to enable the thread-safety for the littlefs APIs.COMPONENTS=RTOS_AWARE
in the Makefile to enable RTOS-friendly features, such as waiting on a semaphore until read completion is indicated through an interrupt or a callback.The dependencies except abstraction-rtos are automatically pulled in when you run the 'make getlibs' command in the ModusToolbox™.
Version | Changes | Reason for Change |
---|---|---|
3.0.0 | Migrate mtb-littlefs Middleware to the HAL Next flow |
For more information, refer to the links in the README.md