mirror of
https://github.com/espressif/esptool.git
synced 2025-10-17 07:32:30 +08:00
fix(write_flash): Detect more cases of unresponsive flash, fix failing flash_size check
This commit is contained in:
@@ -980,7 +980,7 @@ def main(argv=None, esp=None):
|
||||
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):
|
||||
print(
|
||||
"WARNING: Failed to communicate with the flash chip, "
|
||||
"read/write operations will fail. "
|
||||
|
@@ -501,7 +501,9 @@ def write_flash(esp, args):
|
||||
)
|
||||
|
||||
# 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, argfile in args.addr_filename:
|
||||
argfile.seek(0, os.SEEK_END)
|
||||
|
Reference in New Issue
Block a user