Merge firmware before flashing via OpenOCD
Arduino core v2.0.4 contains updated bootloader images that have innacurate default headers. This results in bootloops if firmware is flashed via OpenOCD (e.g. debugging or uploading via debug tools). For this reason, before uploading or debugging we need to merge all binaries (firmware, bootloader, partitions, etc.) via esptoolpy so that the image headers will be adjusted according to --flash-size and --flash-mode arguments. Note that this behavior doesn't occur if uploading is done via esptoolpy, as esptoolpy overrides the binary image headers before flashing.
This commit is contained in:
+14
-7
@@ -261,16 +261,23 @@ class Espressif32Platform(PlatformBase):
|
||||
if any(ignore_conds):
|
||||
return
|
||||
|
||||
load_cmds = [
|
||||
'monitor program_esp "{{{path}}}" {offset} verify'.format(
|
||||
path=to_unix_path(item["path"]), offset=item["offset"]
|
||||
)
|
||||
for item in flash_images
|
||||
]
|
||||
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.append(
|
||||
'monitor program_esp "{%s.bin}" %s verify'
|
||||
% (
|
||||
to_unix_path(debug_config.build_data["prog_path"][:-4]),
|
||||
to_unix_path(
|
||||
debug_config.build_data["prog_path"][:-4]
|
||||
+ ("_merged" if merged_firmware else "")
|
||||
),
|
||||
build_extra_data.get("application_offset", "0x10000"),
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user