From ac44a7fdc32b893afde857e8bd5856dd75e9e40a Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 2 Jun 2018 15:58:00 +0300 Subject: [PATCH] Declare command for checking memory usage --- builder/main.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/builder/main.py b/builder/main.py index 09c71cc..c6ce54a 100644 --- a/builder/main.py +++ b/builder/main.py @@ -128,6 +128,7 @@ platform = env.PioPlatform() env.Replace( __get_board_f_flash=_get_board_f_flash, __get_board_flash_mode=_get_board_flash_mode, + AR="xtensa-esp32-elf-ar", AS="xtensa-esp32-elf-as", CC="xtensa-esp32-elf-gcc", @@ -137,6 +138,7 @@ env.Replace( platform.get_package_dir("tool-esptoolpy") or "", "esptool.py"), RANLIB="xtensa-esp32-elf-ranlib", SIZETOOL="xtensa-esp32-elf-size", + ARFLAGS=["rc"], ASFLAGS=["-x", "assembler-with-cpp"], CFLAGS=["-std=gnu99"], @@ -155,9 +157,15 @@ env.Replace( "-nostdlib", "-Wl,-static", "-u", "call_user_start_cpu0", "-Wl,--undefined=uxTopUsedPriority", "-Wl,--gc-sections" ], + + SIZEPROGREGEXP=r"^(?:\.iram0\.text|\.dram0\.text|\.flash\.text|\.dram0\.data|\.flash\.rodata|)\s+(\d+).*", + SIZEDATAREGEXP=r"^(?:\.dram0\.data|\.dram0\.bss)\s+(\d+).*", + SIZECHECKCMD="$SIZETOOL -A -d $SOURCES", + SIZEPRINTCMD="$SIZETOOL -B -d $SOURCES", + MKSPIFFSTOOL="mkspiffs_${PIOPLATFORM}_${PIOFRAMEWORK}", - SIZEPRINTCMD='$SIZETOOL -B -d $SOURCES', - PROGSUFFIX=".elf") + PROGSUFFIX=".elf" +) # Allow user to override via pre:script if env.get("PROGNAME", "program") == "program":