Žiadny popis

lorol e2dc0d5256 Added SPIFFS-like file write and delete idea to the examples. If the path of a new file does not exits, silently create folders. On file deletion, silently removes empty folders on its path, identically to ESP8266 driver-level implementation. 4 rokov pred
examples e2dc0d5256 Added SPIFFS-like file write and delete idea to the examples. If the path of a new file does not exits, silently create folders. On file deletion, silently removes empty folders on its path, identically to ESP8266 driver-level implementation. 4 rokov pred
src 4b9c163814 Revert the last esp_littlefs merge (https://github.com/joltwallet/esp_littlefs/pull/16) 4 rokov pred
LICENSE fb074d28dd Initial commit 4 rokov pred
README.md 98e6e0b8a8 Merge branch 'HEAD' of https://github.com/lorol/LITTLEFS.git 4 rokov pred
library.json 9b67677007 Requesting acceptance by Arduino Library Manager. Tag v1.0 is for esp32 core release 1.0.4 4 rokov pred
library.properties 9b67677007 Requesting acceptance by Arduino Library Manager. Tag v1.0 is for esp32 core release 1.0.4 4 rokov pred

README.md

LittleFS_esp32

LittleFS library for arduino-esp32

Installation

  • Use Arduino Library Manager
  • Or download / use git to have latest repository of LITTLEFS added to Arduino IDE /libraries folder
    (File > Preferences > Sketchbook location).
  • See #define CONFIG_LITTLEFS_FOR_IDF_3_2 in esp_littlefs.c.
    When defined, code builds with any IDF 3.2 - 4.x.
    On IDF newer than 3.2, it can be commented to enable file timestamp feature. See LITTLEFS_time example.
  • The other #define CONFIG_LITTLEFS_xxxxx are set to optimal default values.
    Read here and here if you want to modify.

Usage

  • Use LITTLEFS same way as SPIFFS
  • A quick startup based on your existing code you can re-define SPIFFS

    #define USE_LittleFS
    
    #include <FS.h>
    #ifdef USE_LittleFS
    #define SPIFFS LITTLEFS
    #include <LITTLEFS.h> 
    #else
    #include <SPIFFS.h>
    #endif 
    
    • Note, this may not work if your sketch uses other libraries that use SPIFFS themselves.

Differences with SPIFFS

  • LittleFS has folders, you need to iterate files in folders. See To Do below.
  • 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) work as expected for folders
  • Speed comparison based on LittleFS_test.ino sketch (for a file 1048576 bytes):
Filesystem Read time [ms] Write time [ms]
FAT 276 14493
LITTLEFS 446* 16387
SPIFFS 767 65622

*The read speed improved by changing #define CONFIG_LITTLEFS_CACHE_SIZE from 128 to 512

Arduino ESP32 LittleFS filesystem upload tool

PlatformIO

  • See LITTLEFS_PlatformIO example here
    ( based on notes below from BlueAndi )
  • Add to platformio.ini: extra_scripts = replace_fs.py

  • Add _replacefs.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.

Credits and license

To Do

  • Submit to be added to Arduino Library Manager
  • Decide on more compatibility (or not) with SPIFFS' lack of folders, similar to esp8266' way:
  • Follow-up / eventually retire this library if LittleFS gets implemented through IDF / esp32 Arduino core.