From 2f2a8d4b51579ea2f708efa4531d70ac4aefd58d Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 26 Sep 2022 11:19:53 +0200 Subject: [PATCH] Better handling of bootloader configuration (#880) --- builder/main.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/builder/main.py b/builder/main.py index 4d2396e..f8516c9 100644 --- a/builder/main.py +++ b/builder/main.py @@ -242,7 +242,7 @@ env.Append( "--chip", mcu, "elf2image", "--flash_mode", "$BOARD_FLASH_MODE", "--flash_freq", "${__get_board_f_flash(__env__)}", - "--flash_size", board.get("upload.flash_size", "detect"), + "--flash_size", board.get("upload.flash_size", "4MB"), "-o", "$TARGET", "$SOURCES" ]), "Building $TARGET"), suffix=".bin" @@ -391,11 +391,12 @@ elif upload_protocol == "esptool": "--chip", mcu, "--port", '"$UPLOAD_PORT"', "--baud", "$UPLOAD_SPEED", - "--before", "default_reset", - "--after", "hard_reset", + "--before", board.get("upload.before_reset", "default_reset"), + "--after", board.get("upload.after_reset", "hard_reset"), "write_flash", "-z", - "--flash_mode", "$BOARD_FLASH_MODE", - "--flash_size", "detect", + "--flash_mode", "${__get_board_flash_mode(__env__)}", + "--flash_freq", "${__get_board_f_flash(__env__)}", + "--flash_size", board.get("upload.flash_size", "detect"), "$FS_START" ], UPLOADCMD='"$PYTHONEXE" "$UPLOADER" $UPLOADERFLAGS $SOURCE',