Skip to content

Commit e6bfc3b

Browse files
committed
fix(write_flash): Detect more cases of unresponsive flash, fix failing flash_size check
1 parent a4ddac0 commit e6bfc3b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

esptool/cmds.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,9 @@ def write_flash(
667667
)
668668

669669
# Verify file sizes fit in the set flash_size, or real flash size if smaller
670-
flash_end = min(set_flash_size, flash_end) if set_flash_size else flash_end
670+
flash_end = (
671+
min(set_flash_size, flash_end) if set_flash_size and flash_end else flash_end
672+
)
671673
if flash_end is not None:
672674
for address, (data, name) in norm_addr_data:
673675
if address + len(data) > flash_end:
@@ -1079,7 +1081,7 @@ def flash_xmc_startup():
10791081
if not esp.secure_download_mode:
10801082
try:
10811083
flash_id = esp.flash_id()
1082-
if flash_id in (0xFFFFFF, 0x000000):
1084+
if flash_id in (0xFFFFFF, 0x000000, 0xFFFF3F):
10831085
log.warning(
10841086
"Failed to communicate with the flash chip, "
10851087
"read/write operations will fail. "

0 commit comments

Comments
 (0)