Skip to content

Commit fbd2e92

Browse files
Marti Bolivarnashif
authored andcommitted
scripts: remove zephyr_flash_debug.py
Since, by design, the west 'flash', 'debug', and 'debugserver' commands operate the same way as the Makefile targets when given no arguments, so just delegate to west from cmake/flash/CMakeLists.txt instead of invoking zephyr_flash_debug.py by hand. Removing the old script is the first step towards being able to clean up the command line argument handling in the runner package, which was always kind of a hack and can be improved now that runner is part of a larger tool. Signed-off-by: Marti Bolivar <[email protected]>
1 parent b611e5b commit fbd2e92

File tree

2 files changed

+13
-137
lines changed

2 files changed

+13
-137
lines changed

cmake/flash/CMakeLists.txt

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -57,44 +57,30 @@ endif()
5757
foreach(target flash debug debugserver)
5858
if(target STREQUAL flash)
5959
set(comment "Flashing ${BOARD}")
60-
set(runner "${BOARD_FLASH_RUNNER}")
6160
elseif(target STREQUAL debug)
6261
set(comment "Debugging ${BOARD}")
63-
set(runner "${BOARD_DEBUG_RUNNER}")
6462
elseif(target STREQUAL debugserver)
6563
set(comment "Debugging ${BOARD}")
66-
set(runner "${BOARD_DEBUG_RUNNER}")
6764
if(EMU_PLATFORM)
6865
# cmake/qemu/CMakeLists.txt will add a debugserver target for
6966
# emulation platforms, so we don't add one here
7067
continue()
7168
endif()
7269
endif()
7370

74-
if(runner)
75-
# E.g. runner_ident = dfu_util (note the underscore), etc.
76-
string(MAKE_C_IDENTIFIER "${runner}" runner_ident)
77-
# E.g. args = BOARD_RUNNER_ARGS_openocd, BOARD_RUNNER_ARGS_dfu_util, etc.
78-
get_property(args GLOBAL PROPERTY "BOARD_RUNNER_ARGS_${runner_ident}")
79-
set(cmd
80-
${CMAKE_COMMAND} -E env
81-
${PYTHON_EXECUTABLE}
82-
${ZEPHYR_BASE}/scripts/meta/zephyr_flash_debug.py
83-
${RUNNER_VERBOSE}
84-
${runner}
85-
${target}
86-
${RUNNER_ARGS_COMMON}
87-
${args}
88-
DEPENDS ${logical_target_for_zephyr_elf}
89-
WORKING_DIRECTORY ${APPLICATION_BINARY_DIR}
90-
)
91-
else()
92-
set(cmd
93-
${CMAKE_COMMAND} -E echo
94-
"'${target}' is not supported with this board."
95-
"Please check the documentation for alternate instructions."
96-
)
97-
endif()
71+
# We pass --skip-rebuild here because the DEPENDS value ensures the
72+
# build is already up to date before west is run.
73+
set(cmd
74+
${CMAKE_COMMAND} -E env
75+
PYTHONPATH=${ZEPHYR_BASE}/scripts/meta
76+
${PYTHON_EXECUTABLE}
77+
-m west
78+
${RUNNER_VERBOSE}
79+
${target}
80+
--skip-rebuild
81+
DEPENDS ${logical_target_for_zephyr_elf}
82+
WORKING_DIRECTORY ${APPLICATION_BINARY_DIR}
83+
)
9884

9985
add_custom_target(${target}
10086
COMMAND

scripts/meta/zephyr_flash_debug.py

Lines changed: 0 additions & 110 deletions
This file was deleted.

0 commit comments

Comments
 (0)