mirror of
https://github.com/MikronMIK32/mik32-uploader.git
synced 2026-01-01 21:37:05 +03:00
remove is_resume traces
This commit is contained in:
parent
1cc8a4cbb2
commit
802a8a77c2
@ -183,7 +183,7 @@ def eeprom_check_data(openocd: OpenOcdTclRpc, words: List[int], offset: int, pri
|
|||||||
return eeprom_check_data_ahb_lite(openocd, words, offset, print_progress)
|
return eeprom_check_data_ahb_lite(openocd, words, offset, print_progress)
|
||||||
|
|
||||||
|
|
||||||
def write_words(words: List[int], openocd: OpenOcdTclRpc, write_by_word=False, read_through_apb=False, is_resume=True) -> int:
|
def write_words(words: List[int], openocd: OpenOcdTclRpc, write_by_word=False, read_through_apb=False) -> int:
|
||||||
"""
|
"""
|
||||||
Write words in MIK32 EEPROM through APB bus
|
Write words in MIK32 EEPROM through APB bus
|
||||||
|
|
||||||
@ -240,8 +240,6 @@ def write_words(words: List[int], openocd: OpenOcdTclRpc, write_by_word=False, r
|
|||||||
result = eeprom_check_data_apb(openocd, words, 0)
|
result = eeprom_check_data_apb(openocd, words, 0)
|
||||||
else:
|
else:
|
||||||
result = eeprom_check_data_ahb_lite(openocd, words, 0)
|
result = eeprom_check_data_ahb_lite(openocd, words, 0)
|
||||||
if is_resume:
|
|
||||||
openocd.resume(0)
|
|
||||||
|
|
||||||
if result == 0:
|
if result == 0:
|
||||||
print("EEPROM write file done!", flush=True)
|
print("EEPROM write file done!", flush=True)
|
||||||
|
|||||||
@ -6,21 +6,17 @@ from pathlib import Path
|
|||||||
|
|
||||||
from utils import bytes2words
|
from utils import bytes2words
|
||||||
|
|
||||||
def write_file(filename, is_resume=True):
|
def write_file(filename):
|
||||||
|
|
||||||
with OpenOcdTclRpc() as openocd:
|
with OpenOcdTclRpc() as openocd:
|
||||||
openocd.reset_halt()
|
openocd.reset_halt()
|
||||||
print(openocd.run("load_image {%s} 0x0" % Path(filename)))
|
print(openocd.run("load_image {%s} 0x0" % Path(filename)))
|
||||||
if is_resume:
|
|
||||||
openocd.resume(0)
|
|
||||||
print("RAM write file maybe done")
|
print("RAM write file maybe done")
|
||||||
|
|
||||||
|
|
||||||
def write_segments(segments: List[Segment], openocd: OpenOcdTclRpc, is_resume=True):
|
def write_segments(segments: List[Segment], openocd: OpenOcdTclRpc):
|
||||||
openocd.reset_halt()
|
openocd.reset_halt()
|
||||||
for segment in segments:
|
for segment in segments:
|
||||||
print("Writing segment %s with size %d..." % (hex(segment.offset), segment.data.__len__()))
|
print("Writing segment %s with size %d..." % (hex(segment.offset), segment.data.__len__()))
|
||||||
segment_words = bytes2words(segment.data)
|
segment_words = bytes2words(segment.data)
|
||||||
openocd.write_memory(segment.offset, 32, segment_words)
|
openocd.write_memory(segment.offset, 32, segment_words)
|
||||||
if is_resume:
|
|
||||||
openocd.resume(0)
|
|
||||||
|
|||||||
@ -443,7 +443,7 @@ def spifi_write(openocd: OpenOcdTclRpc, address: int, data: List[int], data_len:
|
|||||||
print("written")
|
print("written")
|
||||||
|
|
||||||
|
|
||||||
def spifi_write_file(bytes: List[int], openocd: OpenOcdTclRpc, is_resume=True):
|
def spifi_write_file(bytes: List[int], openocd: OpenOcdTclRpc):
|
||||||
# print(bytes)
|
# print(bytes)
|
||||||
print(f"Write {len(bytes)} bytes")
|
print(f"Write {len(bytes)} bytes")
|
||||||
|
|
||||||
@ -468,8 +468,6 @@ def spifi_write_file(bytes: List[int], openocd: OpenOcdTclRpc, is_resume=True):
|
|||||||
if spifi_read_data(openocd, address, len(bytes) - address, bytes) == 1:
|
if spifi_read_data(openocd, address, len(bytes) - address, bytes) == 1:
|
||||||
return 1
|
return 1
|
||||||
print("end")
|
print("end")
|
||||||
if is_resume:
|
|
||||||
openocd.resume(0)
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user