Исправлено чтение результата проверки, выход по первому несовпадению

This commit is contained in:
sh-sergey committed 2024-11-02 11:43:43 +03:00
1 parent b7bdd5fc7d
commit e66c5b0f03
3 files changed
+89 -119

No files matched your search

+6 -10
View File
@@ -291,31 +291,27 @@ def write_memory(pages: Dict[int, List[int]], openocd: OpenOcdTclRpc) -> int:
openocd.halt()
openocd.write_memory(0x02003800, 32, [1])
openocd.run(f"set_reg {{t6 {max_address}}}")
print("EEPROM Init...")
pathname = os.path.dirname(sys.argv[0])
openocd.run("wp 0x2003800 4 w")
print("Loading Driver...", flush=True)
print("Uploading driver...", flush=True)
# openocd.run("load_image {%s}" % pathlib.Path(os.path.join(pathname, "firmware.hex")))
openocd.run("load_image {%s}" % pathlib.Path(
"C:\\Users\\user\\.platformio\\packages\\tool-mik32-uploader\\upload_drivers\\jtag_eeprom\\.pio\\build\\mik32v2\\firmware.hex"
))
# openocd.resume(0x2000000)
# wait_halted(openocd)
# print(f"Check page result {openocd.read_memory(0x2003800, 32, 1)}")
print("Uploading data...", flush=True)
openocd.write_memory(0x02001800, 8, bytes_list)
print("Uploading data complete!", flush=True)
print("Run driver...", flush=True)
print("Uploading data complete! Run driver...", flush=True)
openocd.resume(0x2000000)
wait_halted(openocd, 10)
openocd.run("rwp 0x02003800")
openocd.run("step")
print(f"Check page result {openocd.read_memory(0x2003800, 32, 1)}")
if result == 0:
# Прошивка страниц флеш памяти по SPIFI была завершена
print(f"{datetime.datetime.now().time()} EEPROM recording has been completed", flush=True)
return 0