I'm using the VCode extension to build my project. Recently I saw an increase of my binary from 524kb to 557kb from one moment to the next. Removing 10 variables from the code doesn't change the size of the binary file. I think this is because variables are rather small.
Any ideas what I can remove from menuconfig to save space?
Binary size increased
- ESP_Roland
- Posts: 265
- Joined: Tue Oct 09, 2018 10:28 am
Re: Binary size increased
Hi rosenrot,
tools/idf_size.py has a new --diff option which can be used together with the other options to see differences between MAP files. It might give you an idea what is causing the increase in size.
For further info please run:
tools/idf_size.py has a new --diff option which can be used together with the other options to see differences between MAP files. It might give you an idea what is causing the increase in size.
For further info please run:
Code: Select all
tools/idf_size.py --help
Re: Binary size increased
Thanks for the hint. So the flash code increased by almost 30'000 bytes. Where do I have to search?
Code: Select all
(base) C:\>C:\small.map
Total sizes:
DRAM .data size: 14664 bytes
DRAM .bss size: 11768 bytes
Used static DRAM: 26432 bytes ( 98148 available, 21.2% used)
Used static IRAM: 89828 bytes ( 41244 available, 68.5% used)
Flash code: 355795 bytes
Flash rodata: 74332 bytes
Total image size:~ 546387 bytes (.bin may be padded larger)
Code: Select all
(base) C:\>C:\big.map
Total sizes:
DRAM .data size: 14072 bytes
DRAM .bss size: 13520 bytes
Used static DRAM: 27592 bytes ( 96988 available, 22.1% used)
Used static IRAM: 89308 bytes ( 41764 available, 68.1% used)
Flash code: 381179 bytes
Flash rodata: 84720 bytes
Total image size:~ 582799 bytes (.bin may be padded larger)
- ESP_Roland
- Posts: 265
- Joined: Tue Oct 09, 2018 10:28 am
Re: Binary size increased
Running these commands could give a little more information:
If you identify an archive then you can get more information about which functions caused the increase:
After that you can find the given component in the menuconfig and look for options which can decrease the size.
Code: Select all
$IDF_PATH/tools/idf_size.py --files big.map --diff small.map
$IDF_PATH/tools/idf_size.py --archives big.map --diff small.map
Code: Select all
$IDF_PATH/tools/idf_size.py --archive_details libesp32.a big.map --diff small.map
Who is online
Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 213 guests