Epressif32: 30% growth of .elf file after update v0.12.0 -> 1.0.0

Today the espressif32 platform was upgraded from v0.12.0 to v1.0.0.

I have a code that compiled with 0.12.0 to 1,060,542 bytes firmware.elf
After ugrade to v1.0.0 the same code compiles a 1,390,381 bytes firmware.elf - which is too large to fit in the 1,25MB of an ESP32.

This nearly 40% growth of the binary. Too much to crunch this under 1,25MB by refactoring the code.

What can i do to shrink the firmware.elf?

Is this Arduino or ESP-IDF project?

For me it is an Arduino project (ESPeasy)

We introduced new Memory Usage tool in PlatformIO Core 3.6. You should see new detailed information at the end of a build process. What do you see now?

As workaround i increased app memory by changing partition table from default to no_ota, using the new board partition table feature in platformio.ini. And i set corresponding maximum upload size entry in platformio.ini (can this go automatically?)

But this, of course, does not solve the root cause, that exactly the same code now eats 30% more flash memory as before. This is around +300KB. That’s too large to ignore it in embedded projects world.

With actual PlatformIO version 3.6.0a1 i see this at the end of build process:

Retrieving maximum program size .pioenvs\ttgov21\firmware.elf
Checking size .pioenvs\ttgov21\firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [==        ]  23.9% (used 70488 bytes from 294912 bytes)
PROGRAM: [======    ]  64.3% (used 1349194 bytes from 2097152 bytes)

So, 1349194 bytes is to large for 1,25MB flash in default partition table.
With Espressif 0.12.0 the same code builds a binary which is at around 1,0MB.

The code can be seen here

I did the same test on ESPeasy project for ESP32 build:


Checking size .pioenvs\esp32dev\firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [==        ]  19.0% (used 56052 bytes from 294912 bytes)
PROGRAM: [========= ]  85.1% (used 1114966 bytes from 1310720 bytes)


Checking size .pioenvs\esp32dev\firmware.elf
Building .pioenvs\esp32dev\firmware.bin
Memory Usage -> http://bit.ly/pio-memory-usage

DATA:    [========= ]  86.3% (used 254536 bytes from 294912 bytes)
PROGRAM: [=======   ]  69.6% (used 911921 bytes from 1310720 bytes)
esptool.py v2.1

If I’m correct, this bin-file will be compressed before flashing?
I don’t have those values ready, since flashing is a bit of a problem on my machine.