Support shared serial ports and optional verification in TMS flashing

This commit is contained in:
2026-10-09 16:41:47 +03:00
parent 86ece3ea90
commit f1a7bcd8bc
2 changed files with 45 additions and 4 deletions
+3
View File
@@ -73,6 +73,7 @@ class TmsTarget:
kind: str = "tms"
board: int = 0
load_only: bool = False
verify: bool = True
def validate(self, size: int) -> None:
if not 0 <= self.controller <= 255:
@@ -116,6 +117,8 @@ def programming_steps(data: bytes, target: TmsTarget):
raise ValueError(f"Проверка EEPROM не пройдена: код {error}, обработано {words} слов")
return
yield tflash(t.controller, t.ram, t.flash, len(data)), 6, 180000, "CMD_TFLASH: запись Flash", 85
if not t.verify:
return
for offset in range(0, len(data), 256):
block = data[offset:offset + 256]
count = (len(block) + 1) & ~1