mirror of
https://github.com/espressif/esptool.git
synced 2025-10-18 00:32:43 +08:00
fix(write_flash): Detect more cases of unresponsive flash, fix failing flash_size check
This commit is contained in:
@@ -667,7 +667,9 @@ def write_flash(
|
||||
)
|
||||
|
||||
# Verify file sizes fit in the set flash_size, or real flash size if smaller
|
||||
flash_end = min(set_flash_size, flash_end) if set_flash_size else flash_end
|
||||
flash_end = (
|
||||
min(set_flash_size, flash_end) if set_flash_size and flash_end else flash_end
|
||||
)
|
||||
if flash_end is not None:
|
||||
for address, (data, name) in norm_addr_data:
|
||||
if address + len(data) > flash_end:
|
||||
@@ -1079,7 +1081,7 @@ def attach_flash(
|
||||
if not esp.secure_download_mode:
|
||||
try:
|
||||
flash_id = esp.flash_id()
|
||||
if flash_id in (0xFFFFFF, 0x000000):
|
||||
if flash_id in (0xFFFFFF, 0x000000, 0xFFFF3F):
|
||||
log.warning(
|
||||
"Failed to communicate with the flash chip, "
|
||||
"read/write operations will fail. "
|
||||
|
Reference in New Issue
Block a user