From 46c72768e0d0db339a41f0a4383cc9621601b3de Mon Sep 17 00:00:00 2001 From: Sergey Shchelkanov Date: Mon, 29 May 2023 16:58:36 +0300 Subject: [PATCH] debug output wip --- mik32_spifi.py | 3 ++- mik32_upload.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mik32_spifi.py b/mik32_spifi.py index 96a7a66..fb7660d 100644 --- a/mik32_spifi.py +++ b/mik32_spifi.py @@ -319,7 +319,8 @@ def spifi_read_data(openocd: OpenOcdTclRpc, address: int, byte_count: int, bin_d for i in range(byte_count): data8 = openocd.read_memory(SPIFI_CONFIG_DATA32, 8, 1)[0] read_data.append(data8) - # print(f"DATA[{i+address}] = {read_data[i]:#0x}") + if is_verbose: + print(f"DATA[{i+address}] = {read_data[i]:#0x}") for i in range(byte_count): if read_data[i] != bin_data[i]: diff --git a/mik32_upload.py b/mik32_upload.py index 7b5fc93..a46a761 100644 --- a/mik32_upload.py +++ b/mik32_upload.py @@ -26,6 +26,7 @@ DEFAULT_OPENOCD_SCRIPTS_PATH = os.path.join( supported_formats = [".hex"] +is_verbose = False def test_connection(): output = "" @@ -244,6 +245,8 @@ def createParser(): default=OpenOcdTclRpc.DEFAULT_PORT) parser.add_argument('--keep-halt', dest='keep_halt', action='store_true', default=False) + parser.add_argument('--verbose', dest='is_verbose', + action='store_true', default=False) # parser.add_argument('-b', '--boot-mode', default='undefined') return parser @@ -252,6 +255,7 @@ def createParser(): if __name__ == '__main__': parser = createParser() namespace = parser.parse_args() + is_verbose = namespace.is_verbose if namespace.filepath: upload_file(