Skip to content

Commit

Permalink
fix(write_flash): Skip flash_size checks if we can't read flash size
Browse files Browse the repository at this point in the history
Closes #1045
  • Loading branch information
radimkarnis committed Jan 8, 2025
1 parent 701b956 commit 12095b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion esptool/cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ def write_flash(esp, args):
else: # Check against real flash chip size if not in SDM
flash_end_str = detect_flash_size(esp)
flash_end = flash_size_bytes(flash_end_str)
if set_flash_size and set_flash_size > flash_end:
if set_flash_size and flash_end and set_flash_size > flash_end:
print(
f"WARNING: Set --flash_size {args.flash_size} "
f"is larger than the available flash size of {flash_end_str}."
Expand Down

0 comments on commit 12095b2

Please sign in to comment.