Using LittleFS with ESP32 but app still compiles with SPIFFS+LittleFS #471
Replies: 4 comments 8 replies
-
@HankLloydRight The problem you are encountering is due to the difference between the version of the LittleFS library that had integrated into the ESP32 core 2.0 and an ordinary version published on the ESP32 LittleFS repository. The original LittleFS_esp32 deploys Little FS class and instance as fs::LITTLEFSFS and LITTLEFS: https://github.com/lorol/LITTLEFS/blob/f0817ca5264745acce697092de2bf218b3aa5b2e/src/LITTLEFS.h#L39 On the other hand, in ESP32 Core 2.0, they are declared as fs::LittleFSFS and LittleFS: https://github.com/espressif/arduino-esp32/blob/c2e5957f35b0441e7c954e247437456fabe3800f/libraries/LittleFS/src/LittleFS.h#L39 This change in the ESP32 core 2.0 was made to ensure compatibility with the ESP8266, but as a result, backward compatibility with legacy code for LittleFS_esp32 has been lost. This problem does not occur when building in the Arduino IDE environment because it assumes that LittleFS is integrated with the ESP32 2.0 core. And its class and instance are I temporarily implemented a way to absorb the above gap in the AutoConnect library to support ESP32 LittleFS in AutoConnect and PageBuilder, but eventually dropped it. That's because we estimated that it would not take much time for PlatformIO to support ESP32 core 2.0. How to avoid the problem for now:You will need to employ one of the following two methods. The following workarounds have their limitations. Those limitations will be lifted in the next release as AutoConnect v1.3.4 and PageBuilder v 1.5.3.
|
Beta Was this translation helpful? Give feedback.
-
Wow, thank you Hieromon! You are the best. Thanks for the extremely detailed explanation. Since I don't use the Arduino IDE and only use Platform.io, it seems that Option #1 is the way to go. (modify AutoConnectFS.h and PageBuilder.h) I made those changes and now the code compiles cleanly and my code size went down about 29k. No change in free stack space though. Interestingly, the SPIFFS library is still in the dependency tree. It's remained unchanged from what I posted above. Is that expected? |
Beta Was this translation helpful? Give feedback.
-
Support for the LittleFS_esp32 legacy library in ESP32 core 1.0.6 has been released as AutoConnect v1.3.4 and PageBuilder 1.5.3. |
Beta Was this translation helpful? Give feedback.
-
@HankLloydRight Hello, Today I have something to let you know. The platform-espressif32 platform maintains compatibility with ESP32 Arduino Core 2.0. So the LittleFS_esp32 library installed individually in the Arduino library folder is no longer needed. And if it is left behind, PlatformIO's LDF will detect the LittleFS_esp32, which is supposed to be a residue. Upon that detection, the FS class is expanded to LITTLEFS. In other words, the FS class will be expanded to LITTLEFS prior to 2.0.0 (which is legacy), even though it is a library dependency for Arduino Core 2.0.0 or later, resulting in a compile error for AutoConnect. This error can be resolved by simply deleting the LittleFS_esp32 folder from the Arduino library folder. If you are already aware of this, then my concern is unfounded. Thank you. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I've converted my main ESP32 app to use LittleFS instead of SPIFFS, which is working great. But I still see SPIFFS being compiled in the dependency tree due to AutoConnect and Pagebuilder:
The code compiles clean and runs great, even with both SPIFFS and LITTLEFS in the tree. I'd like to figure out how to not have SPIFFS compiled into the code, hopefully freeing up some code and stack memory. For the record, I am not using any of the Autoconnect features of uploading files or custom web pages that actually need to write to the local FS.
I've read this entire page: https://hieromon.github.io/AutoConnect/filesystem.html#selecting-appropriate-filesystem and I've added this to my platformio.ini file:
But when I do that, I get a long list of compile errors (see below). I've search and search and tried everything I could find, but can't figure out how to get this to compile with only LITTLEFS. I'm sure it's probably one little thing that's triggering all these errors, but I sure can't figure it out. Help me Hieromon, you're my only hope!
Thank you, and thank you for your awesome library!
-HLR
Beta Was this translation helpful? Give feedback.
All reactions