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:
Jeremy Shen
2026-06-10 13:39:11 +08:00
parent 2c48224aea
commit ea3e3b8ac7
6 changed files with 101 additions and 17 deletions
+6
View File
@@ -25,6 +25,8 @@ DEFAULT_CONFIG: dict[str, Any] = {
"bootloader_bin_path": "",
"fsbl_elf_path": "",
"flash_type": "qspi-x4-single",
"flash_model": "s25fl256s1",
"erase_before_program": True,
"firmware_bin_path": "",
"reboot_timeout": 30,
"ping_timeout": 5,
@@ -60,6 +62,8 @@ class Config:
bootloader_bin_path: str = ""
fsbl_elf_path: str = ""
flash_type: str = "qspi-x4-single"
flash_model: str = "s25fl256s1"
erase_before_program: bool = True
firmware_bin_path: str = ""
reboot_timeout: int = 30
ping_timeout: int = 5
@@ -166,6 +170,8 @@ class Config:
"bootloader_bin_path": self._relative_path(self.bootloader_bin_path),
"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,
"firmware_bin_path": self._relative_path(self.firmware_bin_path),
"reboot_timeout": self.reboot_timeout,
"ping_timeout": self.ping_timeout,