espressif / esp-aws-iot

AWS IoT SDK for ESP32 based chipsets
Apache License 2.0
257 stars 154 forks source link

Query about Build System Command idf.py size-components (CA-201) #104

Open YogeshG30 opened 2 years ago

YogeshG30 commented 2 years ago

Dear all,

We are working on Gateway project using ESP32-C3.

We are analyzing memory analysis using idf.py size-components We have one query for output of idf.py size-components.

We found used flash size for OTA_mqtt reference code as below Used flash query: .text + .rodata comes 850KB. But Used Flash Size showing 1571 KB. How "Used Flash Size" derived?

Regards...

Yogesh

ameyinamdar commented 2 years ago

Yogesh, you are not considering IRAM text, DRAM data and padding that gets added into the image. If you see "idf.py size" output, you'll see something like:

Total sizes: Used stat D/IRAM: 99160 bytes ( 228520 remain, 30.3% used) .data size: 19084 bytes .bss size: 20232 bytes .text size: 59844 bytes Used Flash size : 805986 bytes .text : 662416 bytes .rodata : 143314 bytes Total image size: 884914 bytes (.bin may be padded larger)

(note: this is for a different example)

YogeshG30 commented 2 years ago

Hi Amey,

Thanks for the clarification. In your example, .text = 662416 + .rodata = 143314 comes 8,05,730 which is matching with Used Flash size : 805986 bytes

Flash Size In our case as shown above, Flash total (Highlighted orange) we understood addition of DRAM.data + .rtc.data + IRAM0.text + Flash.text + & .rodata + & .appdesc & .rodata_noload So flash size should be 920318

.text + .rodata (Highlighted Yellow) comes 850668. If we add DRAM.data + rtc.data+IRAM0.text then it comes 923135 which is close to 920318 expected.

But total Used Flash size is 1571820 (Highlighted Blue). Why it is not coming around 920318?

Regards...

Yogesh