From d80215d27d368aee879f56446302f2074d2bd1a5 Mon Sep 17 00:00:00 2001 From: Obijuan Date: Tue, 5 Mar 2024 12:50:40 +0100 Subject: [PATCH] util: get_tinyprog_meta(): refactor --- apio/util.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/apio/util.py b/apio/util.py index 7f440bcb..cda551b6 100644 --- a/apio/util.py +++ b/apio/util.py @@ -777,13 +777,35 @@ def get_serial_ports() -> list: # W0703: Catching too general exception Exception (broad-except) # pylint: disable=W0703 -def get_tinyprog_meta(): +def get_tinyprog_meta() -> list: """DOC: TODO""" # -- FIX IT! - _command = join(get_bin_dir(), "tinyprog") + _command1 = join(get_bin_dir(), "tinyprog") + print(f"===========> DEBUG: {_command1}") _command = "tinyprog" result = exec_command([_command, "--pyserial", "--meta"]) + + # '[{"boardmeta": { + # "name": "TinyFPGA BX", + # "fpga": "ice40lp8k-cm81", + # "hver": "1.0.0", + # "uuid": "7d41d659-876b-454a-9a91-51e5f157e80c" + # }, + # "bootmeta": { + # "bootloader": "TinyFPGA USB Bootloader", + # "bver": "1.0.1", + # "update": "https://tinyfpga.com/update/tinyfpga-bx", + # "addrmap": { + # "bootloader": "0x000a0-0x28000", + # "userimage": "0x28000-0x50000", + # "userdata": "0x50000-0x100000" + # }\n + # }, + # "port": "/dev/ttyACM0"\n + # } + # ]' + try: out = result.get("out", "") if out: