diff --git a/cmake/flash/CMakeLists.txt b/cmake/flash/CMakeLists.txt index 892cfa081e..392274891f 100644 --- a/cmake/flash/CMakeLists.txt +++ b/cmake/flash/CMakeLists.txt @@ -36,6 +36,14 @@ function(runners_yaml_append_config) get_runners_prop(elf_file elf "${KERNEL_ELF_NAME}") runners_yaml_append(" # Build outputs:") runners_yaml_append(" elf_file: ${elf}") + if(CONFIG_BUILD_OUTPUT_EXE) + get_runners_prop(exe_file exe "${KERNEL_EXE_NAME}") + else() + get_runners_prop(exe_file exe "") + endif() + if(exe) + runners_yaml_append(" exe_file: ${exe}") + endif() if(CONFIG_BUILD_OUTPUT_HEX) get_runners_prop(hex_file hex "${KERNEL_HEX_NAME}") else() diff --git a/scripts/west_commands/run_common.py b/scripts/west_commands/run_common.py index ba62c5c46f..43d736f2b6 100644 --- a/scripts/west_commands/run_common.py +++ b/scripts/west_commands/run_common.py @@ -411,6 +411,7 @@ def get_runner_config(build_dir, yaml_path, runners_yaml, args=None): return RunnerConfig(build_dir, yaml_config['board_dir'], output_file('elf'), + output_file('exe'), output_file('hex'), output_file('bin'), output_file('uf2'), diff --git a/scripts/west_commands/runners/core.py b/scripts/west_commands/runners/core.py index c1f9eb7439..fa697fa66c 100644 --- a/scripts/west_commands/runners/core.py +++ b/scripts/west_commands/runners/core.py @@ -283,6 +283,7 @@ class RunnerConfig(NamedTuple): build_dir: str # application build directory board_dir: str # board definition directory elf_file: Optional[str] # zephyr.elf path, or None + exe_file: Optional[str] # zephyr.exe path, or None hex_file: Optional[str] # zephyr.hex path, or None bin_file: Optional[str] # zephyr.bin path, or None uf2_file: Optional[str] # zephyr.uf2 path, or None diff --git a/scripts/west_commands/tests/conftest.py b/scripts/west_commands/tests/conftest.py index da89a2df57..0224ad95a6 100644 --- a/scripts/west_commands/tests/conftest.py +++ b/scripts/west_commands/tests/conftest.py @@ -11,6 +11,7 @@ from runners.core import RunnerConfig, FileType RC_BUILD_DIR = '/test/build-dir' RC_BOARD_DIR = '/test/zephyr/boards/test-arch/test-board' RC_KERNEL_ELF = 'test-zephyr.elf' +RC_KERNEL_EXE = 'test-zephyr.exe' RC_KERNEL_HEX = 'test-zephyr.hex' RC_KERNEL_BIN = 'test-zephyr.bin' RC_GDB = 'test-none-gdb' @@ -21,7 +22,7 @@ RC_OPENOCD_SEARCH = ['/test/openocd/search'] @pytest.fixture def runner_config(): '''Fixture which provides a runners.core.RunnerConfig.''' - return RunnerConfig(RC_BUILD_DIR, RC_BOARD_DIR, RC_KERNEL_ELF, + return RunnerConfig(RC_BUILD_DIR, RC_BOARD_DIR, RC_KERNEL_ELF, RC_KERNEL_EXE, RC_KERNEL_HEX, RC_KERNEL_BIN, None, FileType.OTHER, gdb=RC_GDB, openocd=RC_OPENOCD, openocd_search=RC_OPENOCD_SEARCH)