Split out from #18 item 6 — now unblocked since item 1 (ledger removal, PR #62) is merged.
Problem
When verify-flash reports a mismatch, the daemon currently falls through to write-flash and writes all three regions (bootloader + partitions + firmware), even if only one differs. For the common case "only firmware changed", ~1 s is wasted rewriting bootloader.bin and partitions.bin.
Proposed fix
Parse the verify-flash output (or run three separate verify calls with --diff) to determine which regions matched, then call write-flash with only the offset/file pairs for the mismatched regions. Saves ~1 s on the typical firmware-only deploy.
Flow: device tells us what differs → we write only what differs → device verifies the write.
Implementation notes
try_verify_deployment in crates/fbuild-deploy/src/esp32.rs already runs a single verify-flash covering all three regions; extend its VerifyOutcome::Mismatch variant with per-region diff info, or parse the esptool stdout for "Verification OK"/"Verification failed" lines per region.
- Add a
write_regions(regions: &[(offset, path)]) method on Esp32Deployer that builds a write-flash argv with only the specified offset/file pairs.
- Keep a fallback to full write-flash when parsing fails — never block a deploy on parser output.
Dependency
Closed by the espflash native migration if that lands first, since espflash exposes per-region write natively. Otherwise, esptool stdout parsing is the route.
Context
Filed during the issue consolidation that closed tracker #18. See #18 for the original framing.
Split out from #18 item 6 — now unblocked since item 1 (ledger removal, PR #62) is merged.
Problem
When
verify-flashreports a mismatch, the daemon currently falls through towrite-flashand writes all three regions (bootloader + partitions + firmware), even if only one differs. For the common case "only firmware changed", ~1 s is wasted rewriting bootloader.bin and partitions.bin.Proposed fix
Parse the
verify-flashoutput (or run three separate verify calls with--diff) to determine which regions matched, then callwrite-flashwith only the offset/file pairs for the mismatched regions. Saves ~1 s on the typical firmware-only deploy.Flow: device tells us what differs → we write only what differs → device verifies the write.
Implementation notes
try_verify_deploymentincrates/fbuild-deploy/src/esp32.rsalready runs a single verify-flash covering all three regions; extend itsVerifyOutcome::Mismatchvariant with per-region diff info, or parse the esptool stdout for "Verification OK"/"Verification failed" lines per region.write_regions(regions: &[(offset, path)])method onEsp32Deployerthat builds a write-flash argv with only the specified offset/file pairs.Dependency
Closed by the
espflashnative migration if that lands first, since espflash exposes per-region write natively. Otherwise, esptool stdout parsing is the route.Context
Filed during the issue consolidation that closed tracker #18. See #18 for the original framing.