|
@@ -1,6 +1,6 @@
|
|
|
# LittleFS_esp32
|
|
|
|
|
|
-### ***Notice: The Library is been integrated to [Arduino esp32 core idf-release/v4.2 branch](https://github.com/espressif/arduino-esp32/tree/idf-release/v4.2 ) for future major core release.***
|
|
|
+#### ***Notice: The Library is been integrated to [Arduino esp32 core idf-release/v4.2 branch](https://github.com/espressif/arduino-esp32/tree/idf-release/v4.2 ) for future major core release. On built-in library, #define tweaks below will be unavailable.***
|
|
|
|
|
|
|
|
|
## LittleFS library for arduino-esp32
|
|
@@ -8,8 +8,8 @@
|
|
|
- A LittleFS wrapper for Arduino ESP32 of [littlefs-project](https://github.com/littlefs-project/littlefs)
|
|
|
- Based on [ESP-IDF port of joltwallet/esp_littlefs](https://github.com/joltwallet/esp_littlefs) , thank you Brian!
|
|
|
- As a reference, see [LillteFS library for ESP8266 core](https://github.com/esp8266/Arduino/tree/master/libraries/LittleFS)
|
|
|
-- [PR at esp32 core development](https://github.com/espressif/arduino-esp32/pull/4096)
|
|
|
-- [PR at esp-idf development](https://github.com/espressif/esp-idf/pull/5469)
|
|
|
+- [PR](https://github.com/espressif/arduino-esp32/pull/4096) and [merge](https://github.com/espressif/arduino-esp32/pull/4483) at esp32 core development
|
|
|
+- [PR](https://github.com/espressif/esp-idf/pull/5469) at esp-idf development
|
|
|
- The functionality is similar to SPIFFS
|
|
|
|
|
|
### Installation
|
|
@@ -18,13 +18,14 @@
|
|
|
- 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.
|
|
|
+Now it is defined / undefined automatically by detecting the IDF version and core version.
|
|
|
+When defined, the library works with old and new IDFs 3.2 - 4.x but file timestamp feature is removed.
|
|
|
See LITTLEFS_time example.
|
|
|
- See ``` #define CONFIG_LITTLEFS_SPIFFS_COMPAT ``` in **esp_littlefs.c**.
|
|
|
When set to 1, folders are recursively created or deleted if empty on creating/deleting a new file like SPIFFS. Default is 0.
|
|
|
- The other ``` #define CONFIG_LITTLEFS_xxxxx ``` are set to optimal default values.
|
|
|
-Read [here](https://github.com/joltwallet/esp_littlefs/blob/master/Kconfig) and [here](https://github.com/ARMmbed/littlefs/blob/master/README.md) if you want to modify.
|
|
|
+Read [here](https://github.com/joltwallet/esp_littlefs/blob/master/Kconfig) and [here](https://github.com/littlefs-project//littlefs/blob/master/README.md) if you want to modify.
|
|
|
+- For low-level default error reporting modifications, see the defines at beginning of the **lfs.c** here.
|
|
|
|
|
|
### Usage
|
|
|
|
|
@@ -42,16 +43,17 @@ Read [here](https://github.com/joltwallet/esp_littlefs/blob/master/Kconfig) and
|
|
|
#endif
|
|
|
```
|
|
|
- Note, this may not work if your sketch uses other libraries that use SPIFFS themselves.
|
|
|
- - See also [esp_partition.h](https://github.com/espressif/esp-idf/blob/master/components/spi_flash/include/esp_partition.h) . LITTLEFS re-uses same type and subtype.
|
|
|
+ - See also [esp_partition.h](https://github.com/espressif/esp-idf/blob/master/components/spi_flash/include/esp_partition.h) . LITTLEFS re-uses same type and subtype as SPIFFS
|
|
|
|
|
|
### Differences with SPIFFS
|
|
|
|
|
|
-- LittleFS has folders, you need to iterate files in folders or set ``` #define CONFIG_LITTLEFS_SPIFFS_COMPAT 1 ```
|
|
|
+- LittleFS has folders, you need to iterate files in folders unless you set ``` #define CONFIG_LITTLEFS_SPIFFS_COMPAT 1 ```
|
|
|
- At root a "/folder" = "folder"
|
|
|
- Requires a label for mount point, NULL will not work. Recommended is to use default LITTLEFS.begin()
|
|
|
- maxOpenFiles parameter is unused, kept for compatibility
|
|
|
- LITTLEFS.mkdir(path) and LITTLEFS.rmdir(path) are available
|
|
|
- file.seek() behaves like on FFat see [more details](https://github.com/lorol/LITTLEFS/issues/11)
|
|
|
+- file.write() and file.print() when partition space is ending may return different than really written bytes (on other FS is also inconsistent).
|
|
|
- Speed comparison based on **LittleFS_test.ino** sketch (for a file 1048576 bytes):
|
|
|
|
|
|
|Filesystem|Read time [ms]|Write time [ms]|
|
|
@@ -98,4 +100,5 @@ Read [here](https://github.com/joltwallet/esp_littlefs/blob/master/Kconfig) and
|
|
|
- [recursive folders auto creation](https://github.com/esp8266/Arduino/blob/master/libraries/LittleFS/src/LittleFS.cpp#L60) when a new file is created at non-existing path
|
|
|
- [recursive folders auto deletion](https://github.com/esp8266/Arduino/blob/master/libraries/LittleFS/src/LittleFS.h#L149) on "last file" deletion (SPIFFS cannot have "folder w/o file")
|
|
|
- review other differences: opendir(), rmdir(), unlink()
|
|
|
- - [x] Follow-up / retire this library if LittleFS gets implemented through IDF / esp32 Arduino core.
|
|
|
+ - [ ] Retire this library when released by esp32 Arduino core
|
|
|
+ - [ ] Cleanup examples
|