esp_littlefs icon indicating copy to clipboard operation
esp_littlefs copied to clipboard

Inconsistency in `LFS_NAME_MAX` settings (LittleFS / mklittlefs)

Open Jason2866 opened this issue 2 years ago • 6 comments

LittleFs uses as default 64 https://github.com/joltwallet/esp_littlefs/blob/master/Kconfig#L24 For mklittlefs the setting is 32 https://github.com/BrianPugh/mklittlefs/blob/a14dabe444e9a265aab04d085d8ca8f8536d799b/Makefile#L75 Which generates compability problems. ESP8266 uses 32 in general. What is the reason for choosing 64 for the ESP32 IDF / Arduino implementation?

Jason2866 avatar Apr 24 '22 19:04 Jason2866

I think the choice was pretty arbitrary, but it should definitely be fixed to be consistent. Do you have a suggestion/justification for whether the default should be 32 or 64?

BrianPugh avatar Apr 24 '22 19:04 BrianPugh

Good question! It would be nice to be align with esp8266 BUT since LittleFS is introduced in IDF the default 64 is used to compile the Arduino Esp32 librarys for the framework. So a change would be a breaking change here. I opened this issue because the provided mklittlefs tool from Arduino Esp32 does not work to unpack a downloaded LittleFS partition (since the are compiled with 32)

Jason2866 avatar Apr 24 '22 20:04 Jason2866

so I don't really use arduino stuff, but is the following correct:

  1. There's this repo, the "root" project for littlefs on the esp32.
  2. There's lorol's repo, which is sort of like a fork of this repo. This repo is only for arduino esp32 core v1.X.
  3. Lorol's repo got copied over into arduino-esp32.

I'm assuming the mklittlefs you're referring to is linked here, which links to earlephilhower/mklittlefs, the creator of mklittlefs. And those binaries were compiled using the 32-byte path length default.

So, with all of that in consideration, it seems like the easiest way forward is to change the default in this repo for consistency, and independently in the arduino-esp32 to 32 to resolve your issue. Does this seem correct? Because if so, you should also open an issue in arduino-esp32. I didn't see where this value gets configured in the other projects.

BrianPugh avatar Apr 24 '22 23:04 BrianPugh

Hello,

  1. and 2. is correct. 3. This repo is used for IDF and Arduino for LittleFS I will open an issue in Arduino ESP32 repo.

I thought this repo is related is to espressif.

Jason2866 avatar Apr 25 '22 07:04 Jason2866

so for this repo, I'd prefer to keep it to 64 so that it doesn't catch anyone off guard.

I opened up this PR that should pass the config value to the build step of mklittlefs

https://github.com/joltwallet/esp_littlefs/pull/79

Maybe arduino should do something similar instead of downloading a precompiled binary.

I'll merge it when i get a chance to test and think about it more.

BrianPugh avatar Apr 25 '22 17:04 BrianPugh

Thanks for heads up!

Jason2866 avatar Apr 25 '22 19:04 Jason2866

I had the same limit problem not being able to build a littlefs file system with the mklittlefs code within the IDF. This is in conjunction with sveltekit building static web sites for the ESP32. Filenames are just longer. I think the mklittlefs should get the configuration for the LFS_NAME_MAX from the sdkconfig CONFIG_LITTLEFS_OBJ_NAME_LEN when building the binary. Even though this is set to larger, mklittlefs will still fail to build the file system.

aircable avatar Apr 24 '23 21:04 aircable

Fixed in #79. Will be a part of v1.5.4

BrianPugh avatar May 03 '23 20:05 BrianPugh

Thank you!

aircable avatar May 03 '23 22:05 aircable