Output compiled size and static memory usage

This commit is contained in:
Valeriy Koval
2015-02-09 19:57:39 +02:00
parent 2bce970809
commit d7405c44ca
6 changed files with 71 additions and 8 deletions

View File

@@ -20,6 +20,7 @@ env.Replace(
CXX="arm-none-eabi-g++",
OBJCOPY="arm-none-eabi-objcopy",
RANLIB="arm-none-eabi-ranlib",
SIZETOOL="arm-none-eabi-size",
ARFLAGS=["rcs"],
@@ -62,6 +63,8 @@ env.Replace(
"-mcpu=${BOARD_OPTIONS['build']['mcu']}"
],
SIZEPRINTCMD='"$SIZETOOL" -B -d $SOURCES',
UPLOADER=join("$PIOPACKAGES_DIR", "tool-stlink", "st-flash"),
UPLOADERFLAGS=[
"write", # write in flash
@@ -122,6 +125,13 @@ if "uploadlazy" in COMMAND_LINE_TARGETS:
else:
target_bin = env.ElfToBin(join("$BUILD_DIR", "firmware"), target_elf)
#
# Target: Print binary size
#
target_size = env.Alias("size", target_elf, "$SIZEPRINTCMD")
AlwaysBuild(target_size)
#
# Target: Upload by default .bin file
#
@@ -133,4 +143,4 @@ AlwaysBuild(upload)
# Target: Define targets
#
Default(target_bin)
Default([target_bin, target_size])