Merge pull request #64 from valeros/develop

Output compiled size and static memory usage // Resolve #59
This commit is contained in:
Ivan Kravets
2015-02-09 19:59:50 +02:00
6 changed files with 71 additions and 8 deletions

View File

@ -22,6 +22,7 @@ env.Replace(
CXX="avr-g++",
OBJCOPY="avr-objcopy",
RANLIB="avr-ranlib",
SIZETOOL="avr-size",
ARFLAGS=["rcs"],
@ -58,6 +59,8 @@ env.Replace(
"-Wl,--start-group"
],
SIZEPRINTCMD='"$SIZETOOL" --mcu=$BOARD_MCU -C -d $SOURCES',
UPLOADER=join("$PIOPACKAGES_DIR", "tool-avrdude", "avrdude"),
UPLOADERFLAGS=[
"-q", # suppress progress output
@ -159,6 +162,13 @@ if "uploadlazy" in COMMAND_LINE_TARGETS:
else:
target_hex = env.ElfToHex(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 .hex file
#
@ -199,4 +209,4 @@ if is_uptarget:
# Setup default targets
#
Default(target_hex)
Default([target_hex, target_size])

View File

@ -21,6 +21,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"],
@ -60,6 +61,8 @@ env.Replace(
"-mthumb"
],
SIZEPRINTCMD='"$SIZETOOL" -B -d $SOURCES',
UPLOADER=join("$PIOPACKAGES_DIR", "$PIOPACKAGE_UPLOADER", "bossac"),
UPLOADERFLAGS=[
"--info",
@ -104,6 +107,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
#
@ -134,4 +144,4 @@ if is_uptarget:
# Setup default targets
#
Default(target_bin)
Default([target_bin, target_size])

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])

View File

@ -22,6 +22,7 @@ if env.get("BOARD_OPTIONS", {}).get("build", {}).get("core") == "teensy":
CXX="avr-g++",
OBJCOPY="avr-objcopy",
RANLIB="avr-ranlib",
SIZETOOL="avr-size",
ARFLAGS=["rcs"],
@ -39,7 +40,9 @@ if env.get("BOARD_OPTIONS", {}).get("build", {}).get("core") == "teensy":
LINKFLAGS=[
"-mmcu=$BOARD_MCU"
]
],
SIZEPRINTCMD='"$SIZETOOL" --mcu=$BOARD_MCU -C -d $SOURCES'
)
elif env.get("BOARD_OPTIONS", {}).get("build", {}).get("core") == "teensy3":
@ -50,6 +53,7 @@ elif env.get("BOARD_OPTIONS", {}).get("build", {}).get("core") == "teensy3":
CXX="arm-none-eabi-g++",
OBJCOPY="arm-none-eabi-objcopy",
RANLIB="arm-none-eabi-ranlib",
SIZETOOL="arm-none-eabi-size",
ARFLAGS=["rcs"],
@ -82,7 +86,9 @@ elif env.get("BOARD_OPTIONS", {}).get("build", {}).get("core") == "teensy3":
"-Wl,--gc-sections",
# "-nostartfiles",
# "-nostdlib",
]
],
SIZEPRINTCMD='"$SIZETOOL" -B -d $SOURCES'
)
env.Append(
@ -175,6 +181,13 @@ if "uploadlazy" in COMMAND_LINE_TARGETS:
else:
target_hex = env.ElfToHex(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 .hex file
#
@ -186,4 +199,4 @@ AlwaysBuild(upload)
# Target: Define targets
#
Default(target_hex)
Default([target_hex, target_size])

View File

@ -21,6 +21,7 @@ env.Replace(
CXX="msp430-g++",
OBJCOPY="msp430-objcopy",
RANLIB="msp430-ranlib",
SIZETOOL="msp430-size",
ARFLAGS=["rcs"],
@ -52,6 +53,8 @@ env.Replace(
"-Wl,-gc-sections,-u,main"
],
SIZEPRINTCMD='"$SIZETOOL" -B -d $SOURCES',
UPLOADER=join("$PIOPACKAGES_DIR", "tool-mspdebug", "mspdebug"),
UPLOADERFLAGS=[
"$UPLOAD_PROTOCOL" if system() != "Windows" else "tilib",
@ -93,6 +96,13 @@ if "uploadlazy" in COMMAND_LINE_TARGETS:
else:
target_hex = env.ElfToHex(join("$BUILD_DIR", "firmware"), target_elf)
#
# Target: Print binary size
#
target_size = env.Alias("size", target_elf, "$SIZEPRINTCMD")
AlwaysBuild(target_size)
#
# Target: Upload firmware
#
@ -104,4 +114,4 @@ AlwaysBuild(upload)
# Target: Define targets
#
Default(target_hex)
Default([target_hex, target_size])

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"],
@ -71,6 +72,8 @@ env.Replace(
"-fsingle-precision-constant"
],
SIZEPRINTCMD='"$SIZETOOL" -B -d $SOURCES',
UPLOADER=join("$PIOPACKAGES_DIR", "tool-lm4flash", "lm4flash"),
UPLOADCMD="$UPLOADER $SOURCES"
)
@ -106,6 +109,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 firmware
#
@ -117,4 +127,4 @@ AlwaysBuild(upload)
# Target: Define targets
#
Default(target_bin)
Default([target_bin, target_size])