-
-
Notifications
You must be signed in to change notification settings - Fork 583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use LittleFS with ESP-IDF? #965
Comments
You have to add as component, it is not included in IDF. This one is used https://github.com/joltwallet/esp_littlefs.git |
How to add it with platformio ? |
Git clone in components folder. I have done this way https://github.com/tasmota/esp-idf/tree/Tasmota/v4.4 |
I try to find a solution to do it with platformio and not forking the ESPIDF and make modification. For now, we will using the SPIFFS since we don't need to write the FS often (once in the life of the product). Thanx @Jason2866 for your input ! |
I have this problem too. My way of reproducing this problem:
will appear, amongst similar messages. |
The littlefs component needs to be added as component in the Platformio setup. |
Thank you Jason. I'm not sure how to this though. LittleFS may not be included in IDF, but it is included in Arduino framework, which confuses me. |
Yes, but when you compile Arduino as component in IDF no precompiled lib from Arduino is used (where the LittleFS part is included). This is the reason why doing this compile variant. |
Just to be practical: what should one do to use LittleFS in an |
Make |
Will do an example setup (the next days) and will provide a link too. |
HI, I think this is the new feature that is supported. check here https://docs.platformio.org/en/latest/frameworks/espidf.html#esp-idf-components |
@dumarjo not new ;-) |
Again starting with: https://github.com/espressif/arduino-esp32/tree/master/libraries/LittleFS/examples/LITTLEFS_PlatformIO Change platformio.ini file line Now add components/littlefs folder and add source files from https://github.com/littlefs-project/littlefs Add CMakeList.txt file to this folder, with following content:
The CMakeList.txt in the root of the project:
The result:
I have to admin that I have no idea what I'm doing since I know little about CMake. What am I doing wrong here? |
@wijnsema Working dummy LittleFS IDF/Arduion example https://github.com/Jason2866/Arduino_IDF_LittleFS |
Thanks @Jason2866 This project is indeed working properly. A couple of things to note when integrating this into your running project:
|
Sure Jason, your project runs fine. It's just a reminder that people with existing projects that want to use LittleFS should realize that the development branch of 'platform' espressif32 is needed. |
No, it does work fine with standard release. There is no issue. |
Hi @Jason2866, I am trying to build your latest code and I keep on getting the following error:
I can't seem to figure it out. Can you please take a look and let me know? I would like to have LittleFS working with: framework = arduino, espidf Thanks. |
Thanks for the prompt reply. I did try to clone your latest repository and built it as it is (pro run), but I mentioned that error I am having in my previous post. Am I missing something? |
@nelfata For some strange reasons the idf component manager does not work with official |
OK great, that worked. Thanks again. |
Yes that worked too, thanks for the follow up.
|
Just FYI. You may want to mention that in order to upload the files in the data directory it is required to add to platformio.ini the following: board_build.filesystem = littlefs |
Hi @Jason2866 .pio\build\esp32dev\libf72\libESP Mail Client.a(ESP_Mail_Client.cpp.o):(.literal._ZN5MB_FS10createDirsE9MB_String22mb_fs_mem_storage_type[_ZN5MB_FS10createDirsE9MB_String22mb_fs_mem_storage_type]+0x8): undefined reference to I have followed suggestions from this posts but so far no luck. My platform.ini is like this: [env] [env:esp32dev] Any ideas? |
Link to repo with the project? |
https://github.com/borisqbf/mcu/tree/master/IrrigationController managed_components folder (not under source control) includes keep.me file and littlefs folder, which is a clone of main branch of https://github.com/littlefs-project/littlefs |
@borisqbf Sorry, as long the project code does have compile errors in code, i will not look into.
|
Fair enough. The issue is caused by ambiguity in time.h header used by Chronos library. Looks like this lib is out of maintenance and the authors have not replaced time.h with TimeLib.h after Arduino's Time library header Time.h has been renamed to TimeLib.h to avoid a conflict with standard time.h on Case Sensitive operating systems. Excuses aside, I have removed Chronos dependency and added modified Chronos lib source to the source control. Hope it gives you something to work with, in a meantime I'll think about better ways to resolve the issue |
@borisqbf With this
it does compile and links successfully To avoid such lib issues we have decided in our project Tasmota not to use any external dependencies. |
the problem still evident even after adding these two lines to sdkconfig.defaults. I guess the problem is in the content of managed_components folder, because I have nuked my project folder and did fresh pull from the repo before attempting to re-build. |
Add managed components by adding |
Yes! Adding idf_component.yml works. Also a reminder to myself (and may be others) When changing something in project configuration/CMake options, delete build folder to force recompile. Thank you @Jason2866 |
@Jason2866 Your solution works. I spent several days tackling this issue. |
But where is the build folder? |
I have added |
@hitecSmartHome IDF is a large framework with hundreds of files (not to mention Arduino). Each time you modify [platformio]
; Set a path to a cache folder
build_cache_dir = ./cache
[env:esp32dev]
platform = espressif32
framework = espidf
board = esp32dev |
Wow. Thank you I will definitely try this out! |
Well, it doesn't seem to work.
|
|
Oh I see. Sorry for my stupidity. WIll try. |
The LittleFS library seams not to be compiled in when using platform=arduino,espidf.
This result in link error.
I have started the project from the espidf-arduino-blink example.
regards,
The text was updated successfully, but these errors were encountered: