Skip to content

Commit

Permalink
Tools/idf_size.py: Support .noinit sections
Browse files Browse the repository at this point in the history
Closes #8428
  • Loading branch information
dobairoland committed Mar 1, 2022
1 parent ad59ef3 commit f1f0bd3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tools/idf_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,15 @@ def get_display_name_order(section_name_list: List[str]) -> Tuple[List[str], Lis
'''

def get_memory_name(split_name: List) -> Tuple[str, str]:
memory_name = f'.{split_name[1]}'
memory_name = '.{}'.format(split_name[1])
display_name = section
for seg_name in ['iram','dram','flash']:
if seg_name in split_name[1]:
memory_name = f'.{seg_name}'
memory_name = '.{}'.format(seg_name)
seg_name = seg_name.upper() if seg_name != 'flash' else seg_name.capitalize()
display_name = seg_name + ('' if seg_name != 'IRAM' else split_name[1].replace('iram', '')) + f' .{split_name[2]}'
display_name = ''.join([seg_name,
split_name[1].replace('iram', '') if seg_name == 'IRAM' else '',
' .{}'.format(split_name[2]) if len(split_name) > 2 else ''])
return memory_name, display_name

ordered_name_list = sorted(section_name_list)
Expand All @@ -198,7 +200,7 @@ def get_memory_name(split_name: List) -> Tuple[str, str]:
split_name = section.split('.')
if len(split_name) > 1:
# If the section has a memory type, update the type and try to display the type properly
assert len(split_name) == 3 and split_name[0] == '', 'Unexpected section name'
assert split_name[0] == '', 'Unexpected section name "{}"'.format(section)
memory_name, display_name_list[i] = get_memory_name(split_name)
continue

Expand Down

0 comments on commit f1f0bd3

Please sign in to comment.