mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 11:17:20 +02:00
Merge branch 'bugfix/idf_size_wrong_memory_calculations_v4.2' into 'release/v4.2'
Tools: Fix memory calculations of idf_size.py (v4.2) See merge request espressif/esp-idf!14934
This commit is contained in:
1186
tools/idf_size.py
1186
tools/idf_size.py
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,17 +1,32 @@
|
||||
{
|
||||
"dram_data": 9324,
|
||||
"dram_bss": 8296,
|
||||
"dram_rodata": 0,
|
||||
"dram_other": 0,
|
||||
"used_dram": 17620,
|
||||
"available_dram": 163116,
|
||||
"dram_total": 180736,
|
||||
"used_dram_ratio": 0.09749026203966006,
|
||||
"dram_remain": 163116,
|
||||
"iram_vectors": 1024,
|
||||
"iram_text": 37908,
|
||||
"iram_other": 0,
|
||||
"used_iram": 38932,
|
||||
"available_iram": 92140,
|
||||
"iram_total": 131072,
|
||||
"used_iram_ratio": 0.297027587890625,
|
||||
"used_diram": 0,
|
||||
"available_diram": 0,
|
||||
"used_diram_ratio": 0,
|
||||
"iram_remain": 92140,
|
||||
"diram_data": 9324,
|
||||
"diram_bss": 8296,
|
||||
"diram_text": 37908,
|
||||
"diram_vectors": 1024,
|
||||
"diram_rodata": 0,
|
||||
"diram_other": 0,
|
||||
"diram_total": 311808,
|
||||
"used_diram": 56552,
|
||||
"used_diram_ratio": 0.18136802134646962,
|
||||
"diram_remain": 255256,
|
||||
"flash_code": 146944,
|
||||
"flash_rodata": 39580,
|
||||
"total_size": 234780
|
||||
"flash_other": 0,
|
||||
"used_flash_non_ram": 186524,
|
||||
"total_size": 283036
|
||||
}
|
||||
|
@ -1,8 +1,16 @@
|
||||
Total sizes:
|
||||
DRAM .data size: 9324 bytes
|
||||
DRAM .bss size: 8296 bytes
|
||||
Used static DRAM: 17620 bytes ( 163116 available, 9.7% used)
|
||||
Used static IRAM: 38932 bytes ( 92140 available, 29.7% used)
|
||||
Flash code: 146944 bytes
|
||||
Flash rodata: 39580 bytes
|
||||
Total image size:~ 234780 bytes (.bin may be padded larger)
|
||||
Used static DRAM: 17620 bytes ( 163116 remain, 9.7% used)
|
||||
.data size: 9324 bytes
|
||||
.bss size: 8296 bytes
|
||||
Used static IRAM: 38932 bytes ( 92140 remain, 29.7% used)
|
||||
.text size: 37908 bytes
|
||||
.vectors size: 1024 bytes
|
||||
Used stat D/IRAM: 56552 bytes ( 255256 remain, 18.1% used)
|
||||
.data size: 9324 bytes
|
||||
.bss size: 8296 bytes
|
||||
.text size: 37908 bytes
|
||||
.vectors size: 1024 bytes
|
||||
Used Flash size : 186524 bytes
|
||||
.text : 146944 bytes
|
||||
.rodata : 39580 bytes
|
||||
Total image size: 283036 bytes (.bin may be padded larger)
|
||||
|
@ -64,8 +64,6 @@
|
||||
&& coverage run -a $IDF_PATH/tools/idf_size.py --target esp32s2 --archive_details libdriver.a app_esp32s2.map &>> output \
|
||||
&& echo -e "\n***\nRunning idf_size.py diff with another app (different target)..." &>> output \
|
||||
&& coverage run -a $IDF_PATH/tools/idf_size.py app.map --diff app_esp32s2.map &>> output \
|
||||
&& echo -e "\n***\nRunning idf_size.py diff with another app (wrong target)..." &>> output \
|
||||
&& coverage run -a $IDF_PATH/tools/idf_size.py --target esp32s2 app.map --diff app2.map &>> output \
|
||||
&& echo -e "\n***\nProducing JSON output..." &>> output \
|
||||
&& coverage run -a $IDF_PATH/tools/idf_size.py --json app.map &>> output \
|
||||
&& coverage run -a $IDF_PATH/tools/idf_size.py --json --archives app.map &>> output \
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
import collections
|
||||
from typing import Dict
|
||||
|
||||
try:
|
||||
import idf_size
|
||||
@ -34,16 +34,13 @@ if __name__ == "__main__":
|
||||
|
||||
# Should deliver a RuntimeError as there's no content under the heading
|
||||
try:
|
||||
idf_size.load_memory_config(["Memory Configuration"])
|
||||
idf_size.load_segments(['Memory Configuration'])
|
||||
pass
|
||||
except RuntimeError as e:
|
||||
assert "End of file" in str(e)
|
||||
|
||||
# This used to crash with a division by zero error but now it just prints nan% due to
|
||||
# zero lengths
|
||||
MemRegNames = collections.namedtuple('MemRegNames', ['iram_names', 'dram_names', 'diram_names', 'used_iram_names',
|
||||
'used_dram_names', 'used_diram_names'])
|
||||
mem_reg = MemRegNames(set(), set(), set(), set(), set(), set())
|
||||
segments = {'iram0_0_seg': {'origin': 0, 'length': 0},
|
||||
'dram0_0_seg': {'origin': 0, 'length': 0}}
|
||||
sections = {} # type: Dict
|
||||
|
||||
print(idf_size.get_summary('a.map', mem_reg, {"iram0_0_seg": {"origin":0,"length":0}, "dram0_0_seg":
|
||||
{"origin":0, "length":0}}, {}), end="")
|
||||
print(idf_size.get_summary('a.map', segments, sections, 'esp32'), end='')
|
||||
|
Reference in New Issue
Block a user