✨ feat: flash phase tracking, erase checkbox, flash_model config
Step 2 UI now shows real-time flash operation phases parsed from program_flash output: - Erase: "Performing Erase Operation..." → sf erase → Erased: OK - Program: "Performing Program Operation..." → write blocks 0%→100% - Verify: "Performing Verify Operation..." → read+cmp 0%→100% Configuration additions: - erase_before_program checkbox: controls whether to pre-erase before programming - flash_model: chip type for capacity reference (s25fl256s1 = 32 MiB) subprocess_utils.py now emits 'phase' callbacks (erase/program/verify/done) detected from program_flash output transitions.
This commit is contained in:
+16
-5
@@ -279,7 +279,11 @@ def full_flash_program(
|
||||
bin_path: str | Path,
|
||||
callback: ProgressCallback = None,
|
||||
) -> list[FlashResult]:
|
||||
"""Execute full flash workflow: wipe → program → verify.
|
||||
"""Execute full flash workflow: (optional wipe) → program → verify.
|
||||
|
||||
If config.erase_before_program is True, erases flash sectors before
|
||||
programming. Otherwise, program_flash handles sector erase during
|
||||
programming (per-sector, not full chip).
|
||||
|
||||
Args:
|
||||
config: Application configuration.
|
||||
@@ -291,10 +295,17 @@ def full_flash_program(
|
||||
"""
|
||||
results: list[FlashResult] = []
|
||||
|
||||
# Step 1: Erase the entire flash
|
||||
results.append(wipe_flash(config, callback))
|
||||
if not results[-1].success:
|
||||
return results
|
||||
# Step 1: Erase (optional — controlled by config.erase_before_program)
|
||||
if getattr(config, 'erase_before_program', True):
|
||||
results.append(wipe_flash(config, callback))
|
||||
if not results[-1].success:
|
||||
return results
|
||||
else:
|
||||
results.append(FlashResult(
|
||||
step="wipe",
|
||||
success=True,
|
||||
message="Erase skipped (handled by program_flash)",
|
||||
))
|
||||
|
||||
# Step 2: Program and verify (program_flash -verify)
|
||||
results.append(program_flash_bin(config, bin_path, callback))
|
||||
|
||||
Reference in New Issue
Block a user