Update bootloader image headers before debugging or uploading via debug tools
This approach is less intrusive than merging the entire application into one binary implemented in #006d64e8b268e479703a0aac7eed8bef1ebea587 In this implementation we safely copy the required bootloader binary to the build directory, adjust the headers via esptoolpy and the "merge_bin" command according to --flash-size and --flash-mode arguments. Resolves #872
This commit is contained in:
+7
-14
@@ -261,23 +261,16 @@ class Espressif32Platform(PlatformBase):
|
||||
if any(ignore_conds):
|
||||
return
|
||||
|
||||
merged_firmware = build_extra_data.get("merged_firmware", False)
|
||||
load_cmds = []
|
||||
if not merged_firmware:
|
||||
load_cmds.extend([
|
||||
'monitor program_esp "{{{path}}}" {offset} verify'.format(
|
||||
path=to_unix_path(item["path"]), offset=item["offset"]
|
||||
)
|
||||
for item in flash_images
|
||||
])
|
||||
|
||||
load_cmds = [
|
||||
'monitor program_esp "{{{path}}}" {offset} verify'.format(
|
||||
path=to_unix_path(item["path"]), offset=item["offset"]
|
||||
)
|
||||
for item in flash_images
|
||||
]
|
||||
load_cmds.append(
|
||||
'monitor program_esp "{%s.bin}" %s verify'
|
||||
% (
|
||||
to_unix_path(
|
||||
debug_config.build_data["prog_path"][:-4]
|
||||
+ ("_merged" if merged_firmware else "")
|
||||
),
|
||||
to_unix_path(debug_config.build_data["prog_path"][:-4]),
|
||||
build_extra_data.get("application_offset", "0x10000"),
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user