mirror of
https://github.com/espressif/esptool.git
synced 2025-10-15 21:07:25 +08:00
fix(esp32-c2): Enable flashing in secure download mode
Closes https://github.com/espressif/esptool/issues/895
This commit is contained in:

committed by
Radim Karniš

parent
9b95de8901
commit
e862e10e63
@@ -466,7 +466,7 @@ def write_flash(esp, args):
|
||||
flash_end = flash_size_bytes(
|
||||
detect_flash_size(esp) if args.flash_size == "keep" else args.flash_size
|
||||
)
|
||||
if flash_end is not None: # Secure download mode
|
||||
if flash_end is not None: # Not in secure download mode
|
||||
for address, argfile in args.addr_filename:
|
||||
argfile.seek(0, os.SEEK_END)
|
||||
if address + argfile.tell() > flash_end:
|
||||
|
@@ -110,7 +110,7 @@ class ESP32C2ROM(ESP32C3ROM):
|
||||
|
||||
def _post_connect(self):
|
||||
# ESP32C2 ECO0 is no longer supported by the flasher stub
|
||||
if self.get_chip_revision() == 0:
|
||||
if not self.secure_download_mode and self.get_chip_revision() == 0:
|
||||
self.stub_is_disabled = True
|
||||
self.IS_STUB = False
|
||||
|
||||
|
@@ -34,6 +34,8 @@ def flash_size_bytes(size):
|
||||
"""Given a flash size of the type passed in args.flash_size
|
||||
(ie 512KB or 1MB) then return the size in bytes.
|
||||
"""
|
||||
if size is None:
|
||||
return None
|
||||
if "MB" in size:
|
||||
return int(size[: size.index("MB")]) * 1024 * 1024
|
||||
elif "KB" in size:
|
||||
|
Reference in New Issue
Block a user