Created
February 23, 2017 21:54
-
-
Save Sulter/8e7fa0e268074022f2497375b0bd5baa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ] | |
then | |
FILE=main.elf | |
else | |
FILE=$1 | |
fi | |
TOTAL_ROM=1000000 | |
TOTAL_RAM=192000 | |
ROM=$(arm-none-eabi-size $FILE | tail -1 | awk '{print $1+$3}') | |
RAM=$(arm-none-eabi-size $FILE | tail -1 | awk '{print $2+$3}') | |
ROM_PRC=$(echo "scale=2;" $ROM/$TOTAL_ROM*100 | bc -l) | |
RAM_PRC=$(echo "scale=2;" $RAM/$TOTAL_RAM*100 | bc -l) | |
echo "Memory used: " | |
echo -e "ROM:" $ROM/$TOTAL_ROM "\t"$ROM_PRC"%" | |
echo -e "RAM:" $RAM/$TOTAL_RAM "\t"$RAM_PRC"%" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment