mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-09-14 15:31:56 +00:00
This helps by letting us add checks for when the runner has already been set. There is documentation saying you can set -DBOARD_DEBUG_RUNNER at the command line and have it take effect, which turns out not to be true for a large number of boards. A status message helps the user debug. (We'll address the existing in-tree boards in the next patch.) Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
26 lines
731 B
CMake
26 lines
731 B
CMake
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
board_set_flasher_ifnset(openocd)
|
|
board_set_debugger_ifnset(openocd)
|
|
|
|
# "load_image" or "flash write_image erase"?
|
|
if(CONFIG_X86 OR CONFIG_ARC)
|
|
set_ifndef(OPENOCD_USE_LOAD_IMAGE YES)
|
|
endif()
|
|
if(OPENOCD_USE_LOAD_IMAGE)
|
|
set_ifndef(OPENOCD_FLASH load_image)
|
|
else()
|
|
set_ifndef(OPENOCD_FLASH "flash write_image erase")
|
|
endif()
|
|
|
|
# zephyr.elf, or something else?
|
|
set_ifndef(OPENOCD_IMAGE "${PROJECT_BINARY_DIR}/${KERNEL_ELF_NAME}")
|
|
|
|
set(OPENOCD_CMD_LOAD_DEFAULT "${OPENOCD_FLASH} ${OPENOCD_IMAGE}")
|
|
set(OPENOCD_CMD_VERIFY_DEFAULT "verify_image ${OPENOCD_IMAGE}")
|
|
|
|
board_finalize_runner_args(openocd
|
|
--cmd-load "${OPENOCD_CMD_LOAD_DEFAULT}"
|
|
--cmd-verify "${OPENOCD_CMD_VERIFY_DEFAULT}"
|
|
)
|