Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By igrr
#2619 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

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
User avatar
By Gary B
#37483 I see what you are doing.. searching for text-markers ...
but I don't get it running.. tried to set the variable OBJDUMP in several ways but it does not work...
would it be possible to give a step by step advice?

best regards
User avatar
By Gary B
#37536 Got it... just in case what I changed
OS: Ubuntu
1) I changed the first Part of the script into ..
Code: Select allif [ -z "$OBJDUMP" ]; then
   echo "Setting OBJDUMP"
   OBJDUMP=xtensa-lx106-elf-objdump
#   exit 1
fi

2) I did copy mem_usage.sh into the directory of the xtensa-compiler... which is in my case..
/opt/esp-open-sdk/xtensa-lx106-elf/bin
3) Added the path of the compiler to the environment variable $PATH .. which I already did before

now you can run it everywhere by entering...
> bash mem_usage.sh app.out 81920