mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
tools/idf_size: Fixed bug with wrong memory calculation
This commit is contained in:
+4
-9
@@ -228,11 +228,10 @@ def load_map_data(map_file: TextIO) -> Tuple[str, Dict, Dict]:
|
||||
detected_chip = detect_target_chip(map_file)
|
||||
sections = load_sections(map_file)
|
||||
|
||||
# Exclude the .dummy section, which usually means shared region among I/D buses
|
||||
dummy_keys = [key for key in sections if key.endswith(('.dummy'))]
|
||||
if dummy_keys:
|
||||
sections.pop(*dummy_keys)
|
||||
|
||||
# Exclude the dummy and .text_end section, which usually means shared region among I/D buses
|
||||
for key in list(sections.keys()):
|
||||
if key.endswith(('dummy', '.text_end')):
|
||||
sections.pop(key)
|
||||
return detected_chip, segments, sections
|
||||
|
||||
|
||||
@@ -575,8 +574,6 @@ class StructureForSummary(object):
|
||||
r.dram_total = get_size(dram_filter)
|
||||
iram_filter = filter(in_iram, segments)
|
||||
r.iram_total = get_size(iram_filter)
|
||||
if r.diram_total == 0:
|
||||
r.diram_total = r.dram_total + r.iram_total
|
||||
|
||||
def filter_in_section(sections: Iterable[MemRegions.Region], section_to_check: str) -> List[MemRegions.Region]:
|
||||
return list(filter(lambda x: LinkingSections.in_section(x.section, section_to_check), sections)) # type: ignore
|
||||
@@ -584,8 +581,6 @@ class StructureForSummary(object):
|
||||
dram_sections = list(filter(in_dram, sections))
|
||||
iram_sections = list(filter(in_iram, sections))
|
||||
diram_sections = list(filter(in_diram, sections))
|
||||
if not diram_sections:
|
||||
diram_sections = dram_sections + iram_sections
|
||||
flash_sections = filter_in_section(sections, 'flash')
|
||||
|
||||
dram_data_list = filter_in_section(dram_sections, 'data')
|
||||
|
||||
Reference in New Issue
Block a user