Files
IoTManager/lib/LITTLEFS/README.md
Dmitry Borisenko b653ce1e87 start version
2020-07-26 23:48:19 +02:00

3.0 KiB

LITTLEFS

LittleFS library for arduino-esp32

Warning: Tested only with git arduino-esp32 #b92c58d core, which is for ESP-IDF 3.3!
With other versions/releases of the core including release 1.0.4, especially against different IDF this will NOT not work.

  • A LittleFS wrapper for Arduino ESP32 of Mbed LittleFS
  • Based on ESP-IDF port of joltwallet/esp_littlefs , thank you Brian!
  • Functionality is the same and SPIFFS partition scheme and data folder meaning are kept
  • You can use either LITTLEFS or SPIFFS but not both simultaneously on given Arduino project
  • A PR to embed it to esp32 core is made too. See the PR status here

Installation

  • Copy LITTLEFS folder to Arduino IDE embedded libraries place
  • For Win, the default place of arduino-esp32 core libraries is somewhere like: C:\Users\<username>\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries
  • Alternatively, you can put it to your usual libraries place

Usage

  • In your existing code, replace SPIFFS like this
#define USE_LittleFS

#include <FS.h>
#ifdef USE_LittleFS
  #define SPIFFS LITTLEFS
  #include <LITTLEFS.h> 
#else
  #include <SPIFFS.h>
#endif 

Differences with SPIFFS (and in this implementation)

  • LittleFS has folders, you my need to tweak your code to iterate files in folders
  • Root: /someting = something, so attention to /
  • Lower level littlefs library cannot mount on NULL as partition_label name, while SPIFFS can
  • Lower level littlefs library does not need maxOpenFiles parameter
  • Speed (LITTLEFS_Test.ino) 1048576 bytes written in 16238 ms / 1048576 bytes read in 918 ms
  • Speed (SPIFFS_Test.ino) 1048576 bytes written in 65971 ms / 1048576 bytes read in 680 ms

Arduino ESP32 LittleFS filesystem upload tool

  • Download the tool archive from here
  • In your Arduino sketchbook directory, create tools directory if it doesn't exist yet.
  • Unpack the tool into tools directory (the path will look like <home_dir>/Arduino/tools/ESP32LittleFS/tool/esp32littlefs.jar).
  • You need the mklittlefs tool Download the release and copy it to packages\esp32\tools\mkspiffs<mklittlefs rev. x.x.x>\ or on checkout (dev) environment to: packages\esp32\hardware\esp32<release>\tools\mklittlefs\
  • Restart Arduino IDE.

Credits and license

To Do

  • Supporting different IDF versions