mirror of
https://github.com/MikronMIK32/mik32-uploader.git
synced 2026-01-01 13:37:03 +03:00
Небольшие исправления вывода при загрузке
This commit is contained in:
parent
bb0b86d37b
commit
6839b3763d
@ -308,13 +308,15 @@ def write_memory(pages: Dict[int, List[int]], openocd: OpenOcdTclRpc, driver_pat
|
|||||||
pathname = os.path.dirname(sys.argv[0])
|
pathname = os.path.dirname(sys.argv[0])
|
||||||
openocd.run("wp 0x2003800 4 w") # готовимся поймать результат записи
|
openocd.run("wp 0x2003800 4 w") # готовимся поймать результат записи
|
||||||
|
|
||||||
print("Uploading driver...", flush=True)
|
print("Uploading driver... ", end="", flush=True)
|
||||||
openocd.run("load_image {%s}" % pathlib.Path(driver_path))
|
openocd.run(f"load_image {{{pathlib.Path(driver_path)}}}")
|
||||||
|
print("OK!", flush=True)
|
||||||
|
|
||||||
print("Uploading data...", flush=True)
|
print("Uploading data... ", end="", flush=True)
|
||||||
openocd.write_memory(0x02001800, 8, bytes_list)
|
openocd.write_memory(0x02001800, 8, bytes_list)
|
||||||
|
print("OK!", flush=True)
|
||||||
|
|
||||||
print("Uploading data complete! Run driver...", flush=True)
|
print("Run driver...", flush=True)
|
||||||
openocd.resume(0x2000000)
|
openocd.resume(0x2000000)
|
||||||
|
|
||||||
wait_halted(openocd, 10) # ждем, когда watchpoint сработает
|
wait_halted(openocd, 10) # ждем, когда watchpoint сработает
|
||||||
|
|||||||
@ -393,17 +393,19 @@ def write_pages_by_sectors(pages: Dict[int, List[int]],
|
|||||||
|
|
||||||
openocd.run("wp 0x2003000 4 w")
|
openocd.run("wp 0x2003000 4 w")
|
||||||
|
|
||||||
print("Uploading driver...", flush=True)
|
print("Uploading driver... ", end="", flush=True)
|
||||||
openocd.run("load_image {%s}" % pathlib.Path(driver_path))
|
openocd.run(f"load_image {{{pathlib.Path(driver_path)}}}")
|
||||||
|
print("OK!", flush=True)
|
||||||
|
|
||||||
openocd.resume(0x2000000)
|
openocd.resume(0x2000000)
|
||||||
wait_halted(openocd)
|
wait_halted(openocd)
|
||||||
|
|
||||||
|
print("Writing Flash by sectors...", flush=True)
|
||||||
|
|
||||||
for i, sector in enumerate(sectors_list):
|
for i, sector in enumerate(sectors_list):
|
||||||
# print(f"Program sector {sector}", flush=True)
|
|
||||||
ByteAddress = sector
|
ByteAddress = sector
|
||||||
progress = f"{(i*100)//len(sectors_list)}%"
|
progress = f"{(i*100)//len(sectors_list)}%"
|
||||||
print(f"Writing Flash sector {ByteAddress:#010x}... {progress:>4}", end="", flush=True)
|
print(f" {ByteAddress:#010x} {progress:>4}", end="", flush=True)
|
||||||
bytes_list: List[int] = []
|
bytes_list: List[int] = []
|
||||||
for page in range(16):
|
for page in range(16):
|
||||||
page = pages.get(page * 256 + sector)
|
page = pages.get(page * 256 + sector)
|
||||||
@ -428,14 +430,14 @@ def write_pages_by_sectors(pages: Dict[int, List[int]],
|
|||||||
print("result =", result)
|
print("result =", result)
|
||||||
break
|
break
|
||||||
if result == 0:
|
if result == 0:
|
||||||
print(f"Writing Flash sector {sectors_list[-1]:#010x}... 100% OK!", flush=True)
|
print(f" {sectors_list[-1]:#010x} 100% OK!", flush=True)
|
||||||
|
|
||||||
openocd.run("rwp 0x02003800")
|
openocd.run("rwp 0x02003800")
|
||||||
init_memory(openocd)
|
init_memory(openocd)
|
||||||
|
|
||||||
if result == 0:
|
if result == 0:
|
||||||
# Прошивка страниц флеш памяти по SPIFI была завершена
|
# Прошивка страниц флеш памяти по SPIFI была завершена
|
||||||
print("SPIFI writing successfully completed", flush=True)
|
print("SPIFI writing successfully completed!", flush=True)
|
||||||
else:
|
else:
|
||||||
print(f"SPIFI writing failed!", flush=True)
|
print(f"SPIFI writing failed!", flush=True)
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user