-
Notifications
You must be signed in to change notification settings - Fork 13.3k
LittleFS library linked when not used #6691
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
Comments
Is it needed to have LittleFS included like this? Arduino/libraries/ESP8266HTTPUpdateServer/src/ESP8266HTTPUpdateServer-impl.h Lines 95 to 102 in 3733ece
Wouldn't it make more sense to have a define stating which filesystem has to be included? |
You've a good point. If you were using SPIFFS, would not want to include LittleFS code. And if using LittleFS then SPIFFS code (almost as big) is wasted, too. A Alternative, probably 3.0 since it changes API, is to require the app to stop the FS itself before beginning an update process. So you would call FS.end() manually before httpupdate.begin(). |
I thought the documentation says that anyway already... |
Do you have a link to that? |
It does indeed state that the HTTPUpdateServer should only be called after stopping the filesystem. Right now that update server does call the end on both filesystem types, which causes both to be included. If it was always meant to be called only with a running filesystem, then it is just a matter of removing these lines from that HTTPUpdateServer code. Edit: |
Does it make sense, instead of calling |
I guess that does make sense, although I do not yet see the implications of these kind of implementations with regard to these |
Fixes esp8266#6691 Idea is to use same principal of weak references to allow the call to SPIFFS.end() only to ever be linked in (along with all of SPIFFS) if there is a call somewhere in the app to SPIFFS.begin(). The biggest use case is httpUpdateServer which includes both LittleFS and SPIFFS code because it has embedded SPIFFS/LittleFS.end() calls. Standard apps need no changes and continue using standard calls. Users of the HttpUpdateServer will automatically save an extra 10-40K of code if they do not use one or both filesystems, or will be unaffected if they use both.
Will try it later this evening. |
Uh oh!
There was an error while loading. Please reload this page.
I've been browsing through my builds using the very nice and new Inspect tool from the (not yet released) PIO 4.1.0rc1 which allows me to browse through the binary and see all libs included and its size. (big, big kudo's for that tool!)
I noticed the LittleFS lib is linked even though I am not using it in my build (as far as I know)
Is this needed to be linked in when only using SPIFFS?
It does occupy about 20k in the build (compiled with debug, so release size my be less)
Apparently it is included here:
Arduino/libraries/ESP8266HTTPUpdateServer/src/ESP8266HTTPUpdateServer-impl.h
Line 8 in 3733ece
The same applies to ESP8266SdFat and SDFS. (not 100% sure that's not included by accident)
The text was updated successfully, but these errors were encountered: