Chapter 4. API Guides
(continued from previous page)
tcp_in.c.o 0 52 0 0 0 8750 ␣
,→1282 10084
trc.o 664 88 0 1726 0 6245 ␣
,→1108 9831
tasks.c.o 8 704 0 7594 0 0 ␣
,→1475 9781
ecp_curves.c.o 28 0 0 0 0 7384 ␣
,→2325 9737
ecp.c.o 0 64 0 0 0 8864 ␣
,→286 9214
ieee80211_hostap.o 1 41 0 0 0 8578 ␣
,→585 9205
wdev.o 121 125 0 4499 0 3684 ␣
,→580 9009
tcp_out.c.o 0 0 0 0 0 5686 ␣
,→2161 7847
tcp.c.o 2 26 0 0 0 6161 ␣
,→1617 7806
ieee80211_input.o 0 0 0 0 0 6797 ␣
,→973 7770
wpa.c.o 0 656 0 0 0 6828 ␣
,→ 55 7539
[... additional lines removed ...]
After the summary of total sizes, a table of “Per-file contributions to ELF file”is printed.
The columns are the same as shown above for idy.py size-components, but this time the granularity is the
contribution of each individual object file to the binary size.
For example, we can see that the file x509_crt_bundle.S.o contributed 64212 bytes to the total firmware size,
all as .rodata in flash. Therefore we can guess that this application is using the ESP x509 Certificate Bundle feature
and not using this feature would save at last this many bytes from the firmware size.
Some of the object files are linked from binary libraries and therefore you won’t find a corresponding source file.
To locate which component a source file belongs to, it’s generally possible to search in the ESP-IDF source tree or
look in the Linker Map File for the full path.
Comparing Two Binaries If making some changes that affect binary size, it’s possible to use an ESP-IDF tool
to break down the exact differences in size.
This operation isn’t part of idf.py, it’s necessary to run the idf-size.py Python tool directly.
To do so, first locate the linker map file in the build directory. It will have the name PROJECTNAME.map. The
idf-size.py tool performs its analysis based on the output of the linker map file.
To compare with another binary, you will also need its corresponding .map file saved from the build directory.
For example, to compare two builds: one with the default CONFIG_COMPILER_OPTIMIZATION setting “Debug
(-Og)”configuration and one with “Optimize for size (-Os)”:
$ $IDF_PATH/tools/idf_size.py --diff build_Og/https_request.map build_Os/https_
,→request.map
<CURRENT> MAP file: build_Os/https_request.map
<REFERENCE> MAP file: build_Og/https_request.map
Difference is counted as <CURRENT> - <REFERENCE>, i.e. a positive number means␣
,→that <CURRENT> is larger.
Total sizes of <CURRENT>:
,→<REFERENCE> Difference
DRAM .data size: 14516 bytes ␣
,→14956 -440
DRAM .bss size: 15792 bytes ␣
,→15808 -16
(continues on next page)
Espressif Systems 1447
Submit Document Feedback
Release v4.4