diff --git a/mik32_eeprom.py b/mik32_eeprom.py index b3919ed..25d9db0 100644 --- a/mik32_eeprom.py +++ b/mik32_eeprom.py @@ -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) -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 @@ -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) else: result = eeprom_check_data_ahb_lite(openocd, words, 0) - if is_resume: - openocd.resume(0) if result == 0: print("EEPROM write file done!", flush=True) diff --git a/mik32_ram.py b/mik32_ram.py index fd0ffb8..c16dea5 100644 --- a/mik32_ram.py +++ b/mik32_ram.py @@ -6,21 +6,17 @@ from pathlib import Path from utils import bytes2words -def write_file(filename, is_resume=True): +def write_file(filename): with OpenOcdTclRpc() as openocd: openocd.reset_halt() print(openocd.run("load_image {%s} 0x0" % Path(filename))) - if is_resume: - openocd.resume(0) 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() for segment in segments: print("Writing segment %s with size %d..." % (hex(segment.offset), segment.data.__len__())) segment_words = bytes2words(segment.data) openocd.write_memory(segment.offset, 32, segment_words) - if is_resume: - openocd.resume(0) diff --git a/mik32_spifi.py b/mik32_spifi.py index bbc76c4..8d09143 100644 --- a/mik32_spifi.py +++ b/mik32_spifi.py @@ -443,7 +443,7 @@ def spifi_write(openocd: OpenOcdTclRpc, address: int, data: List[int], data_len: 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(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: return 1 print("end") - if is_resume: - openocd.resume(0) return 0