Skip to content
Permalink
Browse files

boards: allow cmake-time overrides of all runners

Convert all board_set_xxer(foo) calls to board_set_xxer_ifndef(foo),
which allows the user to make their own decision at CMake time.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
  • Loading branch information...
mbolivar authored and carlescufi committed May 31, 2019
1 parent 1717332 commit 35d4e62300b929c063f930bf83c03ff67bd04047
@@ -1,12 +1,12 @@
# SPDX-License-Identifier: Apache-2.0

if(DEFINED ENV{ZEPHYR_FLASH_OVER_DFU})
board_set_flasher(dfu-util)
board_set_flasher_ifnset(dfu-util)
else()
board_set_flasher(openocd)
board_set_flasher_ifnset(openocd)
endif()

board_set_debugger(openocd)
board_set_debugger_ifnset(openocd)

board_runner_args(dfu-util "--pid=8087:0aba" "--alt=sensor_core")
board_runner_args(openocd --cmd-pre-load "targets 1" "--gdb-port=3334")
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: Apache-2.0

# TODO: can this board just use the usual openocd runner?
board_set_flasher(em-starterkit)
board_set_debugger(em-starterkit)
board_set_flasher_ifnset(em-starterkit)
board_set_debugger_ifnset(em-starterkit)
board_finalize_runner_args(em-starterkit)
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: Apache-2.0

# TODO: can this board just use the usual openocd runner?
board_set_flasher(em-starterkit)
board_set_debugger(em-starterkit)
board_set_flasher_ifnset(em-starterkit)
board_set_debugger_ifnset(em-starterkit)
board_finalize_runner_args(em-starterkit)
@@ -2,8 +2,8 @@

set(EMU_PLATFORM nsim)

board_set_flasher(arc-nsim)
board_set_debugger(arc-nsim)
board_set_flasher_ifnset(arc-nsim)
board_set_debugger_ifnset(arc-nsim)

if(${CONFIG_SOC_NSIM_EM})
board_runner_args(arc-nsim "--props=nsim_em.props")
@@ -10,4 +10,4 @@ set(QEMU_FLAGS_${ARCH}
-vga none
)

board_set_debugger(qemu)
board_set_debugger_ifnset(qemu)
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: Apache-2.0

board_set_flasher(pyocd.sh)
board_set_debugger(pyocd.sh)
board_set_flasher_ifnset(pyocd.sh)
board_set_debugger_ifnset(pyocd.sh)

set(PYOCD_TARGET nrf52)

@@ -10,4 +10,4 @@ set(QEMU_FLAGS_${ARCH}
-vga none
)

board_set_debugger(qemu)
board_set_debugger_ifnset(qemu)
@@ -1,3 +1,3 @@
# SPDX-License-Identifier: Apache-2.0

board_set_debugger(openocd)
board_set_debugger_ifnset(openocd)
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: Apache-2.0

board_set_flasher(esp32)
board_set_flasher_ifnset(esp32)

if(NOT DEFINED ESP_IDF_PATH)
if(DEFINED ENV{ESP_IDF_PATH})
@@ -9,4 +9,4 @@ set(QEMU_FLAGS_${ARCH}
-nographic
)

board_set_debugger(qemu)
board_set_debugger_ifnset(qemu)
@@ -9,6 +9,6 @@ set(QEMU_FLAGS_${ARCH}
-machine sifive_e
)

board_set_debugger(qemu)
board_set_flasher(hifive1)
board_finalize_runner_args(hifive1)
board_set_debugger_ifnset(qemu)
board_set_flasher_ifnset(hifive1)
board_finalize_runner_args(hifive1)
@@ -9,4 +9,4 @@ set(QEMU_FLAGS_${ARCH}
-machine sifive_e
)

board_set_debugger(qemu)
board_set_debugger_ifnset(qemu)
@@ -1,10 +1,10 @@
# SPDX-License-Identifier: Apache-2.0

if(DEFINED ENV{ZEPHYR_FLASH_OVER_DFU})
board_set_flasher(dfu-util)
board_set_flasher_ifnset(dfu-util)
endif()

board_set_debugger(openocd)
board_set_debugger_ifnset(openocd)

board_runner_args(dfu-util "--pid=8087:0aba" "--alt=x86_app")
board_runner_args(openocd --cmd-pre-load "targets 1")
@@ -17,6 +17,6 @@ set(QEMU_FLAGS_${ARCH}
)

# TODO: Support debug
# board_set_debugger(qemu)
# board_set_debugger_ifnset(qemu)
# debugserver: QEMU_EXTRA_FLAGS += -s -S
# debugserver: qemu
@@ -1,10 +1,10 @@
# SPDX-License-Identifier: Apache-2.0

if(DEFINED ENV{ZEPHYR_FLASH_OVER_DFU})
board_set_flasher(dfu-util)
board_set_flasher_ifnset(dfu-util)
endif()

board_set_debugger(openocd)
board_set_debugger_ifnset(openocd)

board_runner_args(dfu-util "--pid=8087:0aba" "--alt=x86_app")
board_runner_args(openocd --cmd-pre-load "targets 1")
@@ -37,6 +37,6 @@ set(QEMU_FLAGS_${ARCH}
)

# TODO: Support debug
# board_set_debugger(qemu)
# board_set_debugger_ifnset(qemu)
# debugserver: QEMU_EXTRA_FLAGS += -s -S
# debugserver: qemu
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: Apache-2.0

board_set_flasher(intel_s1000)
board_set_debugger(intel_s1000)
board_set_flasher_ifnset(intel_s1000)
board_set_debugger_ifnset(intel_s1000)

board_finalize_runner_args(intel_s1000
"--xt-ocd-dir=/opt/tensilica/xocd-12.0.4/xt-ocd"
@@ -9,6 +9,6 @@ set(QEMU_FLAGS_${ARCH}
)

# TODO: Support debug
# board_set_debugger(qemu)
# board_set_debugger_ifnset(qemu)
# debugserver: QEMU_EXTRA_FLAGS += -s -S
# debugserver: qemu
@@ -1,3 +1,3 @@
# SPDX-License-Identifier: Apache-2.0

board_set_debugger(xtensa)
board_set_debugger_ifnset(xtensa)

0 comments on commit 35d4e62

Please sign in to comment.
You can’t perform that action at this time.