Skip to content

Commit cc7b553

Browse files
authored
allow digest
1 parent 1df0ce4 commit cc7b553

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tools/platformio-build.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
# Extends: https://github.com/platformio/platform-espressif32/blob/develop/builder/main.py
2626

2727
from os.path import abspath, basename, isdir, isfile, join
28+
from copy import deepcopy
2829
from SCons.Script import DefaultEnvironment, SConscript
2930

3031
env = DefaultEnvironment()
@@ -101,7 +102,6 @@ def generate_bootloader_image(bootloader_elf):
101102
env.VerboseAction(" ".join([
102103
'"$PYTHONEXE" "$OBJCOPY"',
103104
"--chip", build_mcu, "elf2image",
104-
"--dont-append-digest",
105105
"--flash_mode", "${__get_board_flash_mode(__env__)}",
106106
"--flash_freq", "${__get_board_f_flash(__env__)}",
107107
"--flash_size", board_config.get("upload.flash_size", "4MB"),
@@ -256,3 +256,13 @@ def add_tinyuf2_extra_image():
256256
),
257257
)
258258
env.Depends("$BUILD_DIR/$PROGNAME$PROGSUFFIX", partition_table)
259+
260+
#
261+
# Adjust the `esptoolpy` command in the `ElfToBin` builder with firmware checksum offset
262+
#
263+
264+
action = deepcopy(env["BUILDERS"]["ElfToBin"].action)
265+
action.cmd_list = env["BUILDERS"]["ElfToBin"].action.cmd_list.replace(
266+
"-o", "--elf-sha256-offset 0xb0 -o"
267+
)
268+
env["BUILDERS"]["ElfToBin"].action = action

0 commit comments

Comments
 (0)