mirror of
https://github.com/espressif/esptool.git
synced 2025-10-18 18:01:15 +08:00
fix(secure_download_mode): Disable secure boot detection and print more info
This commit is contained in:
@@ -906,6 +906,10 @@ def main(argv=None, esp=None):
|
|||||||
flash_size = detect_flash_size(esp, args)
|
flash_size = detect_flash_size(esp, args)
|
||||||
elif args.flash_size == "keep":
|
elif args.flash_size == "keep":
|
||||||
flash_size = detect_flash_size(esp, args=None)
|
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:
|
else:
|
||||||
flash_size = args.flash_size
|
flash_size = args.flash_size
|
||||||
|
|
||||||
|
@@ -230,7 +230,7 @@ def detect_flash_size(esp, args=None):
|
|||||||
if flash_size is None:
|
if flash_size is None:
|
||||||
flash_size = "4MB"
|
flash_size = "4MB"
|
||||||
print(
|
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"
|
f"(FlashID={flash_id:#x}, SizeID={size_id:#x}), defaulting to 4MB"
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
@@ -568,11 +568,11 @@ def write_flash(esp, args):
|
|||||||
print("WARNING: File %s is empty" % argfile.name)
|
print("WARNING: File %s is empty" % argfile.name)
|
||||||
continue
|
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)
|
image = _update_image_flash_params(esp, address, args, image)
|
||||||
else:
|
else:
|
||||||
print(
|
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()
|
calcmd5 = hashlib.md5(image).hexdigest()
|
||||||
uncsize = len(image)
|
uncsize = len(image)
|
||||||
|
Reference in New Issue
Block a user