File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 2323import subprocess
2424import sys
2525
26+ def get_segment_hints ():
27+ hints = {}
28+ hints ['IROM' ] = ' - code in flash (default or ICACHE_FLASH_ATTR)'
29+ hints ['IRAM' ] = ' / 32768 - code in IRAM (ICACHE_RAM_ATTR, ISRs...)'
30+ hints ['DATA' ] = ') - initialized variables (global, static) in RAM/HEAP'
31+ hints ['RODATA' ] = ') / 81920 - constants (global, static) in RAM/HEAP'
32+ hints ['BSS' ] = ') - zeroed variables (global, static) in RAM/HEAP'
33+ return hints
34+
2635def get_segment_sizes (elf , path ):
2736 sizes = {}
2837 sizes ['IROM' ] = 0
@@ -53,10 +62,11 @@ def main():
5362
5463 args = parser .parse_args ()
5564 sizes = get_segment_sizes (args .elf , args .path )
65+ hints = get_segment_hints ()
5666
5767 sys .stderr .write ("Executable segment sizes:" + os .linesep )
5868 for k in sizes .keys ():
59- sys .stderr .write ("%-7s: %d%s " % (k , sizes [k ], os .linesep ))
69+ sys .stderr .write ("%-7s: %-5d %s %s " % (k , sizes [ k ], hints [k ], os .linesep ))
6070
6171 return 0
6272
You can’t perform that action at this time.
0 commit comments