-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
drastic changes in firmware size (IDFGH-1516) #3781
Comments
Hi @ammaree , Agree that 10KB is a large amount of binary size shift. A have two questions so we can help narrow this down:
|
Hi @projectgus Git commit SHA after updating is the latest fdab15d Getting the size components on the before application might be a bit difficult unless I: I have attached the after "size-components" file. If you can tell me how to revert to the "before" status I will do so and rebuild. |
? |
To revert to an earlier version, you can do |
When problem was discovered and originally logged, no changed had been made to our application. 24 hours later some changes had been made hence not a completely simple process to revert to the state yesterday. |
Ok but if idf is responsible for the 10k it shouldn't be dependent on your app so as long as it builds on the older idf you should be able to compare |
Correct, will rebuild both and hopefully see same/similar difference |
Have done, new before and after sizes attached. |
Thanks for the info @ammaree . We've updated both mbedTLS and LWIP versions in between the two commits you're using.
|
@ammaree Is it possible to share your |
If you want the exact SDK for the "before" or "after" build, might be a bit difficult. File extention was changed to allow attaching. Hope this helps |
Hi @ammaree , A short update on this: For mbedTLS, it looks like most of the increase is from our default/recommended config in the new version so we can't change this part automatically. However if you want to save code size from mbedTLS, there are a number of options you can disable in the project config to make substantial reductions - for example removing ciphersuites that you don't intend to use. For LWIP, most of the increase is from new IPV6 related features added in LWIP 2.1.2. We're currently testing which of these features can have config options to disable them, without causing problems in other supported functionality. We may also offer the option to disable IPV6 entirely, which would save significant binary size if not needed, but this requires additional testing again. |
LwIP: The option to disable IPv6 would be superb. Considering that our service and device are contained to a very small ecosystem, and that the use of IPv6 within our ecosystem is currently ~0% this will buy us significant time MbedTLS: Our current ESP32 device communicates via HTTPS and MQTT(s) to our own cloud service hence we have complete control of both sides. The only external (to our eco system) communications is between devices and Google Maps API's to do geolocation and TZ determination, on a very irregular basis. Some advice from yourselves (or anyone in the community) to choose the optimal cipher suite providing the best balance of speed and size (whilst accommodating Google API requirements) would be of great value. |
+1 would also like to disable IPv6 Currently disabling IPv6 (CONFIG_LWIP_IPV6) results in a failing build on latest master (cf457d4) |
@AshUK could you please open a new issue for this, attaching the build log and your sdkconfig file? |
@igrr sorry should have been clearer. By disabling coap and asio components i.e adding the following to the root CMakeLists.txt Our project makes no use of the COAP or ESP-ASIO component. So not sure why it built by default. Happy to open a new issue if this is actually an unintended consequence, but i would say its not worthy of time investigating. Apologies for polluting this thread. |
Thanks for explanation, and my bad — I didn't realize the example was disabling
The default behavior of ESP-IDF build system (added for compatibility with the legacy Make based build system) is to build all components in IDF and in the project. The unused components are then eliminated by the linker. It is typically slower than building just the things that are needed, but we decided to do it this way because:
We understand that it is now hard to change this default behaviour since so many projects rely on it, but I'm not going to digress further :) I mentioned above that it is possible to trim down the list of components included in the build. The "Build System" documentation page in IDF Programming Guide describes this, but here is the idea in a nutshell:
As the result, the build system will determine the component dependencies, and will only include the components required + all their recursive dependencies + "common" components (which are always built, like To make it clear to anyone who will be reading this later, trimming down the build this way generally doesn't result in any size reduction of the final app (the topic of this ticket). The linker is already doing as much as possible in removing unused code at link time, and removing unused components from the build will not cause any difference for the code size. |
I tried adding set(EXCLUDE_COMPONENTS "coap" "asio") in CMakeLists.txt,
|
@AxelLin My guess is that we aren't testing the combination of CONFIG_LWIP_PPP_SUPPORT=y and CONFIG_LWIP_IPV6=n, and it isn't working. Would you mind opening a new issue about this, preferably attaching your sdkconfig and mentioning the IDF version? |
Just to share:
|
Regarding the LWIP_IPV6 issue, a change to remove the need to manually disable components is in review. Regarding binary size, a new Performance Guide section soon will be added to ESP-IDF Programming Guide soon that includes steps for analyzing binary size and tips for reducing it. This issue will be updated when that guide has merged. |
… coap - Removes need to manually exclude these components as shown at #3781 (comment) - Hide the config for these components if IPV6 is disabled - The components are still included in the build, but with no source files
… coap - Removes need to manually exclude these components as shown at #3781 (comment) - Hide the config for these components if IPV6 is disabled - The components are still included in the build, but with no source files Backport of e305f29 Closes #7816
… coap - Removes need to manually exclude these components as shown at espressif/esp-idf#3781 (comment) - Hide the config for these components if IPV6 is disabled - The components are still included in the build, but with no source files * Original commit: espressif/esp-idf@e305f29
… coap - Removes need to manually exclude these components as shown at espressif/esp-idf#3781 (comment) - Hide the config for these components if IPV6 is disabled - The components are still included in the build, but with no source files * Original commit: espressif/esp-idf@e305f29
… coap - Removes need to manually exclude these components as shown at espressif/esp-idf#3781 (comment) - Hide the config for these components if IPV6 is disabled - The components are still included in the build, but with no source files * Original commit: espressif/esp-idf@e305f29
… coap - Removes need to manually exclude these components as shown at espressif/esp-idf#3781 (comment) - Hide the config for these components if IPV6 is disabled - The components are still included in the build, but with no source files * Original commit: espressif/esp-idf@e305f29
After upgrading from the previous master (as of 6 July) to current master (as of 13 July) the size of my firmware has increased from 970,512 to 981,952 (about 11KB) without ANY CHANGE in the application.
Is there anywhere in the system documentation where such changes are listed, alternatively is there an automated method whereby the modules and/or functions responsible can be identified?
A change of a couple of hundred byte or maybe a KB or 2 can be ignored but >10KB in 1 week sounds very rough.
The text was updated successfully, but these errors were encountered: