Skip to content

Commit

Permalink
fix(secure_download_mode): Disable secure boot detection and print mo…
Browse files Browse the repository at this point in the history
…re info
  • Loading branch information
radimkarnis committed Mar 14, 2024
1 parent 0215786 commit 1dc3c8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions esptool/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,10 @@ def flash_xmc_startup():
flash_size = detect_flash_size(esp, args)
elif args.flash_size == "keep":
flash_size = detect_flash_size(esp, args=None)
if not esp.IS_STUB:
print(
"WARNING: In case of failure, please set a specific --flash_size."
)
else:
flash_size = args.flash_size

Expand Down
6 changes: 3 additions & 3 deletions esptool/cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def detect_flash_size(esp, args=None):
if flash_size is None:
flash_size = "4MB"
print(
"Warning: Could not auto-detect Flash size "
"WARNING: Could not auto-detect Flash size "
f"(FlashID={flash_id:#x}, SizeID={size_id:#x}), defaulting to 4MB"
)
else:
Expand Down Expand Up @@ -568,11 +568,11 @@ def write_flash(esp, args):
print("WARNING: File %s is empty" % argfile.name)
continue

if not esp.get_secure_boot_enabled():
if not esp.secure_download_mode and not esp.get_secure_boot_enabled():
image = _update_image_flash_params(esp, address, args, image)
else:
print(
"WARNING: Secure boot is enabled, so not changing any flash settings."
"WARNING: Security features enabled, so not changing any flash settings."
)
calcmd5 = hashlib.md5(image).hexdigest()
uncsize = len(image)
Expand Down

0 comments on commit 1dc3c8b

Please sign in to comment.