Skip to content

Commit dbf3d1c

Browse files
committed
feat(write_flash): Remove the superfluous --verify option
BREAKING CHANGE
1 parent 1ce02db commit dbf3d1c

File tree

4 files changed

+22
-21
lines changed

4 files changed

+22
-21
lines changed

docs/en/esptool/basic-commands.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
Basic Commands
44
==============
55

6+
.. _write-flash:
7+
68
Write Binary Data to Flash: write_flash
79
----------------------------------------
810

docs/en/migration-guide.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,19 @@ The esptool ``v5`` release introduces a centralized logging mechanism to improve
4040
3. Update GUIs or tools to leverage the progress tracking API for better user feedback during lengthy operations.
4141

4242
See the :ref:`logging <logging>` section for more details on available logger methods and custom logger implementation.
43+
44+
``write_flash`` ``--verify`` Argument
45+
*************************************
46+
47+
The ``--verify`` option for the :ref:`write_flash <write-flash>` command has been **deprecated in v5**. Flash verification is performed automatically after every successful write operation when technically feasible.
48+
49+
**Behavior:**
50+
51+
- Verification occurs by default after flashing completes.
52+
- No action is needed to enable verification - it is mandatory when possible.
53+
- Verification is **skipped** if Secure Download Mode (SDM) is active or during encrypted writes (using ``--encrypt``).
54+
55+
**Migration Steps:**
56+
57+
1. Remove all ``--verify`` arguments from existing ``write_flash`` commands.
58+
2. Update scripts/CI pipelines to remove ``--verify`` flags.

esptool/__init__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -347,12 +347,6 @@ def add_spi_flash_subparsers(
347347
parser_write_flash.add_argument(
348348
"--no-progress", "-p", help="Suppress progress output", action="store_true"
349349
)
350-
parser_write_flash.add_argument(
351-
"--verify",
352-
help="Verify just-written data on flash "
353-
"(mostly superfluous, data is read back during flashing)",
354-
action="store_true",
355-
)
356350
parser_write_flash.add_argument(
357351
"--encrypt",
358352
help="Apply flash encryption when writing data "

esptool/cmds.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,10 @@ def write_flash(esp, args):
741741
log.print("Hash of data verified.")
742742
except NotImplementedInROMError:
743743
pass
744+
else:
745+
log.print(
746+
"Cannot verify written data if encrypted or in secure download mode."
747+
)
744748

745749
if esp.IS_STUB:
746750
# skip sending flash_finish to ROM loader here,
@@ -758,21 +762,6 @@ def write_flash(esp, args):
758762
else:
759763
esp.flash_finish(False)
760764

761-
if args.verify:
762-
log.print("Verifying just-written flash...")
763-
log.print(
764-
"(This option is deprecated, "
765-
"flash contents are now always read back after flashing.)"
766-
)
767-
# If some encrypted files have been flashed,
768-
# print a warning saying that we won't check them
769-
if args.encrypt or args.encrypt_files is not None:
770-
log.warning("Cannot verify encrypted files, they will be ignored.")
771-
# Call verify_flash function only if there is at least
772-
# one non-encrypted file flashed
773-
if not args.encrypt:
774-
verify_flash(esp, args)
775-
776765

777766
def image_info(args):
778767
log.print(f"File size: {get_file_size(args.filename)} (bytes)")

0 commit comments

Comments
 (0)