forked from platformio/platformio-core
Output compiled size and static memory usage
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user