Open softhack007 opened 1 month ago
Update: omitting "-g3 -ggdb" saves another 26 kB on the wrover build.
Flash: 85.8% (used 1461869 bytes)
This is beyond my skill level but IMO if we can resolve flash use increase in latest platforms it would be best if we upgraded ESP32 to use newer platform in general. Platform 3.5.0 is ancient to say the least.
This is beyond my skill level but IMO if we can resolve flash use increase in latest platforms it would be best if we upgraded ESP32 to use newer platform in general. Platform 3.5.0 is ancient to say the least.
yes, this is what i was thinking, too. 80-100Kb might be enough to recover from the core size increase in the new framework.
The only problem that remains - as explained previously:
in userland most people flash their devices once from install.wled.me, then update by OTA. Unfortunately, OTA cannot update the bootloader. Going to the new framework means that we'll have lots of "V3 bootloader and V4 firmware" setups. In the past this caused very unresponsive devices (suspected case LittleFs). Not sure if this is still happening. We definitely need more testing to safeguard the "OTA to V4" upgrade path on esp32.
So we might go for this change after 0.15.0 is released - to have some more time for testing. We also need to check how development is affected. My first experience with LTO was "WTF" when i got my first exception decoder dump, and it was completely gibberish (all functions renamed to "zaXXXXX").
Another option to decrease flash size is creating a custom arduino-esp32 where unneeded features (rainmaker, insights, bluetooth, etc) are removed. I've never tried it, but @Aircoookie did something similar for the old framework. And @troyhacks has some experiences with this for the new arduino framework. Plan B: use a Tasmota framework, as the tasmota team is already having their own custom arduino framework that saves around 150Kb program size.
@softhack007 - yes, absolutely can reliably build the v4 and v5 frameworks now without the overhead (or at least test that out)
My v5.3 for the ESP32-P4 has all of the extras removed. No Rainmaker, Insights, NN, etc.
This is a continuation (and replacement) for
3824 by @deece
Thanks to the contribution made by @deece to platform-espressif32, link time optimization is now possible in esp32 framework version 6.6.0 and above without hacking build scripts (8266 - no way, sorry).
Overview and background
https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-flto
size comparison
83.6kB saved
Flash: 92.3% (used 1572241 bytes)
Flash: 87.4% (used 1488605 bytes)
80.5kB saved
Flash: 73.0% (used 1530305 bytes)
Flash: 69.1% (used 1449817 bytes)
71.7kB saved
Flash: 91.4% (used 1437945 bytes)
Flash: 86.9% (used 1366221 bytes)
72.3kB saved
Flash: 92.7% (used 1458094 bytes)
Flash: 88.1% (used 1385770 bytes)