Skip to content

Write options

Every command that writes flash (write, write-image, write-nvs, write-fs, write-bundle, factory, ota) takes the same options, most of them passed through to esptool's write-flash. They go after the command name, and any left unset keep the default.

idftool write storage build/spiffs.bin --diff --no-progress
Option Purpose
--skip-flashed / --no-skip-flashed Skip each file whose partition already holds it. All or nothing per file.
--diff / --no-diff Rewrite only the flash sectors that differ.
--compress / --no-compress Compress data on the way to the device. On by default unless the flasher stub is disabled.
--encrypt Encrypt the data as it is written, for flash encryption.
--force Ignore safety and content checks: chip or revision mismatch, secure boot, flash size. See flashing an incompatible image.
--ignore-flash-enc-efuse Ignore the flash encryption eFuse settings.
--no-progress Don't print progress while writing.

Skipping what's already there

--skip-flashed and --diff are on by default for every command except write-image, so reflashing the same thing is nearly instant and a small change rewrites only the sectors it touched.

--skip-flashed
Hashes the partition on the device and compares it with the file, like esptool's option of the same name, but in chunks, so a mismatch is found early. The first sector is checked on its own first: an app keeps its version and ELF hash there, so a different build is usually caught in milliseconds.
--diff
Compares a sector at a time and writes each run of changed sectors. If so much differs that the comparison stops paying for itself, it falls back to writing the whole region.

write-image adds --erase/--no-erase (on by default), and refuses --skip-flashed unless the erase is off: nothing can match a chip that was just wiped. See write-image.

write-table doesn't take these, and always skips a table that's already in flash. Its --force already means "flash a table that failed verification".

From Python, the same names work as keyword arguments. See Python library.