feat: collapsible flash sub-steps UI + erase_all checkbox

Rename erase_before_program → erase_all (semantics fix):
- erase_all: true  → -erase_all -erase_only (entire flash chip)
- erase_all: false → -erase_only (sectors matching BIN size)
Both options always erase; the checkbox controls scope, not yes/no.

UI additions:
- SubStepFrame widget: collapsible Erase/Program/Verify sub-steps
  with status dots (○/◉/●) and colored labels
- Automatically expands on Step 2 start, collapses on completion
- Phase and progress driven by real-time program_flash output parsing
- Checkbox label: '整片Flash擦除 (Erase entire flash)'

subprocess_utils.py phase detection:
- Parses 'Performing Erase/Program/Verify Operation' for phase transitions
- Emits 'phase' callbacks (erase/program/verify/done)
- Progress % tracked within current phase
This commit is contained in:
Jeremy Shen
2026-06-10 13:45:57 +08:00
parent ea3e3b8ac7
commit 95c04d94ae
6 changed files with 190 additions and 37 deletions
+3 -3
View File
@@ -26,7 +26,7 @@ DEFAULT_CONFIG: dict[str, Any] = {
"fsbl_elf_path": "",
"flash_type": "qspi-x4-single",
"flash_model": "s25fl256s1",
"erase_before_program": True,
"erase_all": False,
"firmware_bin_path": "",
"reboot_timeout": 30,
"ping_timeout": 5,
@@ -63,7 +63,7 @@ class Config:
fsbl_elf_path: str = ""
flash_type: str = "qspi-x4-single"
flash_model: str = "s25fl256s1"
erase_before_program: bool = True
erase_all: bool = False
firmware_bin_path: str = ""
reboot_timeout: int = 30
ping_timeout: int = 5
@@ -171,7 +171,7 @@ class Config:
"fsbl_elf_path": self._relative_path(self.fsbl_elf_path),
"flash_type": self.flash_type,
"flash_model": self.flash_model,
"erase_before_program": self.erase_before_program,
"erase_all": self.erase_all,
"firmware_bin_path": self._relative_path(self.firmware_bin_path),
"reboot_timeout": self.reboot_timeout,
"ping_timeout": self.ping_timeout,