- A LittleFS wrapper for Arduino ESP32 of Mbed LittleFS
- Based on ESP-IDF port of joltwallet/esp_littlefs , thank you Brian!
- See also the LillteFS library for ESP8266 core
- Functionality is similar to SPIFFS
- Either LITTLEFS or SPIFFS but not both simultaneously can be used in same Arduino project
- Related PR in esp32 core development
- Tested with esp32-core #git b92c58d and on core release 1.0.4
- See LITTLEFS_time example for enabling file timestamps
- Copy LITTLEFS to other Arduino IDE libraries
(see File > Preferences > Sketchbook location).
- use LITTLEFS same way as SPIFFS
- A quick startup based on your existing code you can re-define SPIFFS like this
#define USE_LittleFS
#include <FS.h>
#ifdef USE_LittleFS
#define SPIFFS LITTLEFS
#include <LITTLEFS.h>
#else
#include <SPIFFS.h>
#endif
- LittleFS has folders, you need need to iterate files in folders
- At root a "/folder" = "folder"
- Requires a label for mount point, NULL will not work
- maxOpenFiles parameter is unused, kept for compatibility
- LITTLEFS.mkdir(path) and LITTLEFS.rmdir(path)
- Speed comparison based on LittleFS_test.ino sketch (for a file 1048576 bytes):
Filesystem | Read time [ms] | Write time [ms] |
---|---|---|
FAT | 276 | 14493 |
SPIFFS | 767 | 65622 |
LITTLEFS | 916 | 16200 |
- Download the jar file from here
- In your Arduino sketchbook directory, create tools directory if it doesn"t exist yet.
- Copy the tool into tools directory
<home_dir>/Arduino/tools/ESP32LittleFS/tool/esp32littlefs.jar
- Alternatively you can replace the arduino-esp32fs-plugin with this variant, which supports SPIFFS and LittleFS, both
- Requires mklittlefs executable - download the zipped binary here or from esp-quick-toolchain releases here
- Copy the binary to
packages\esp32\hardware\esp32\<x.x.x>\tools\mklittlefs\
folder - Restart Arduino IDE.
(notes from BlueAndi )
-
Add to platformio.ini:
extra_scripts = replace_fs.py
-
Add replace_fs.py to project root directory (where platformio.ini is located):
Import("env")
print("Replace MKSPIFFSTOOL with mklittlefs.exe")
env.Replace (MKSPIFFSTOOL = "mklittlefs.exe")
- Add mklittlefs.exe to project root directory as well.
- This work is based on Mbed LittleFS , ESP-IDF port of joltwallet/esp_littlefs , Espressif Arduino core for the ESP32, the ESP-IDF - SPIFFS Library
- Licensed under GPL v2 (text)