Getting memory usage at compile time
Posted: Fri Nov 14, 2014 11:38 am
This is a reply to a question that was asked here somewhere, but I couldn't find the existing topic.
Here's a short script to get memory usage (data, rodata, bss) at compile time, like with avr-gcc.
https://gist.github.com/igrr/43f8b8c3c4f883f980e5
edit: added free size reporting
Here's a short script to get memory usage (data, rodata, bss) at compile time, like with avr-gcc.
https://gist.github.com/igrr/43f8b8c3c4f883f980e5
Code: Select all
$ OBJDUMP=../xtensa-lx106-elf/bin/xtensa-lx106-elf-objdump ./mem_usage.sh app.out 81920
data: 2644
rodata: 3400
bss: 29536
total: 35580
free: 46340
edit: added free size reporting