From 3d7c332512469f9fd6d36f21882fbe7fb3a77eb4 Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Tue, 21 Sep 2021 16:33:44 -0700 Subject: [PATCH 1/2] add target support --- .../template_project/microtvm_api_server.py | 19 ++++++++++++++++--- python/tvm/target/target.py | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/apps/microtvm/zephyr/template_project/microtvm_api_server.py b/apps/microtvm/zephyr/template_project/microtvm_api_server.py index f2e091b2f5b5..138e71489bff 100644 --- a/apps/microtvm/zephyr/template_project/microtvm_api_server.py +++ b/apps/microtvm/zephyr/template_project/microtvm_api_server.py @@ -96,6 +96,10 @@ "board": "qemu_cortex_r5", "model": "zynq_mp_r5", }, + "mimxrt1050_evk": { + "board": "mimxrt1050_evk", + "model": "imxrt10xx", + }, } @@ -180,6 +184,9 @@ def _get_device_args(options): if flash_runner == "openocd": return _get_openocd_device_args(options) + if flash_runner == "jlink": + return [] + raise BoardError( f"Don't know how to find serial terminal for board {CMAKE_CACHE['BOARD']} with flash " f"runner {flash_runner}" @@ -191,6 +198,7 @@ def _get_device_args(options): "nucleo_l4r5zi": {"idVendor": 0x0483, "idProduct": 0x374B}, "nucleo_f746zg": {"idVendor": 0x0483, "idProduct": 0x374B}, "stm32f746g_disco": {"idVendor": 0x0483, "idProduct": 0x374B}, + "mimxrt1050_evk": {"idVendor": 0x1366, "idProduct": 0x0105}, } @@ -586,6 +594,10 @@ def _find_openocd_serial_port(cls, options): return ports[0].device + @classmethod + def _find_jlink_serial_port(cls, options): + return cls._find_openocd_serial_port(options) + @classmethod def _find_serial_port(cls, options): flash_runner = _get_flash_runner() @@ -596,9 +608,10 @@ def _find_serial_port(cls, options): if flash_runner == "openocd": return cls._find_openocd_serial_port(options) - raise FlashRunnerNotSupported( - f"Don't know how to deduce serial port for flash runner {flash_runner}" - ) + if flash_runner == "jlink": + return cls._find_jlink_serial_port(options) + + raise RuntimeError(f"Don't know how to deduce serial port for flash runner {flash_runner}") def __init__(self, options): self._options = options diff --git a/python/tvm/target/target.py b/python/tvm/target/target.py index af2f5d857293..6d9b702fe2a4 100644 --- a/python/tvm/target/target.py +++ b/python/tvm/target/target.py @@ -286,7 +286,7 @@ def intel_graphics(model="unknown", options=None): "atsamd51": ["-mcpu=cortex-m4"], "cxd5602gg": ["-mcpu=cortex-m4"], "esp32": [], - "imxrt1060": ["-mcpu=cortex-m7"], + "imxrt10xx": ["-mcpu=cortex-m7"], "mps2_an521": ["-mcpu=cortex-m33"], "nrf52840": ["-mcpu=cortex-m4"], "nrf5340dk": ["-mcpu=cortex-m33"], From 132d14a001bbd33444a097dc7241d21dd2289fde Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Mon, 27 Sep 2021 10:18:10 -0700 Subject: [PATCH 2/2] fix ci issue --- apps/microtvm/zephyr/template_project/boards.json | 4 +++- apps/microtvm/zephyr/template_project/microtvm_api_server.py | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/microtvm/zephyr/template_project/boards.json b/apps/microtvm/zephyr/template_project/boards.json index 60d45a23bff7..aabed3322150 100644 --- a/apps/microtvm/zephyr/template_project/boards.json +++ b/apps/microtvm/zephyr/template_project/boards.json @@ -1,7 +1,9 @@ { "mimxrt1050_evk": { "board": "mimxrt1050_evk", - "model": "imxrt10xx" + "model": "imxrt10xx", + "is_qemu": false, + "fpu": true }, "mps2_an521": { "board": "mps2_an521", diff --git a/apps/microtvm/zephyr/template_project/microtvm_api_server.py b/apps/microtvm/zephyr/template_project/microtvm_api_server.py index f5b32ed8a106..f700b5774c72 100644 --- a/apps/microtvm/zephyr/template_project/microtvm_api_server.py +++ b/apps/microtvm/zephyr/template_project/microtvm_api_server.py @@ -151,9 +151,6 @@ def _get_device_args(options): if flash_runner == "openocd": return _get_openocd_device_args(options) - if flash_runner == "jlink": - return [] - raise BoardError( f"Don't know how to find serial terminal for board {CMAKE_CACHE['BOARD']} with flash " f"runner {flash_runner}"