From 220f4ce3dc934d8a85d675c85b71486b0ae85f76 Mon Sep 17 00:00:00 2001 From: Gustavo Romero Date: Fri, 10 Sep 2021 06:05:20 -0300 Subject: [PATCH] [microTVM] Zephyr: implement 'west_cmd' server option (#8941) Currently Zephyr Project API server lists option 'west_cmd' as an option available in Zephyr platform by advertising it in PROJECT_OPTIONS but that option is not used by any API method. That commit adds that option to the server as a non-required option to the build() interface method, allowing the user to specify an alternative path to the west tool. If that option is not specified the Zephyr build system takes care of searching for west as a module (so relying on West being available on Python, i.e. relying on 'python3 -m west'). Signed-off-by: Gustavo Romero --- apps/microtvm/zephyr/template_project/microtvm_api_server.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/microtvm/zephyr/template_project/microtvm_api_server.py b/apps/microtvm/zephyr/template_project/microtvm_api_server.py index 08ba1a16e5ec..8a393c564137 100644 --- a/apps/microtvm/zephyr/template_project/microtvm_api_server.py +++ b/apps/microtvm/zephyr/template_project/microtvm_api_server.py @@ -447,6 +447,9 @@ def build(self, options): if options.get("zephyr_base"): cmake_args.append(f"-DZEPHYR_BASE:STRING={options['zephyr_base']}") + if options.get("west_cmd"): + cmake_args.append(f"-DWEST={options['west_cmd']}") + cmake_args.append(f"-DBOARD:STRING={options['zephyr_board']}") check_call(cmake_args, cwd=BUILD_DIR)