From 395bcbe88399adcd0134711ad6da56d6a42297ea Mon Sep 17 00:00:00 2001 From: Gustavo Romero Date: Mon, 6 Sep 2021 20:28:35 +0000 Subject: [PATCH] [microTVM] Zephyr: implement 'west_cmd' server option 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 f267648a83f9..36debd94aa59 100644 --- a/apps/microtvm/zephyr/template_project/microtvm_api_server.py +++ b/apps/microtvm/zephyr/template_project/microtvm_api_server.py @@ -399,6 +399,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)