diff --git a/boards/arc/arduino_101_sss/Makefile.board b/boards/arc/arduino_101_sss/Makefile.board index f4001bad4fc..4dc7665a495 100644 --- a/boards/arc/arduino_101_sss/Makefile.board +++ b/boards/arc/arduino_101_sss/Makefile.board @@ -9,7 +9,7 @@ FLASH_SCRIPT = openocd.sh endif DEBUG_SCRIPT = openocd.sh -OPENOCD_PRE_CMD = "-c targets 1" +OPENOCD_PRE_CMD = "targets 1" OPENOCD_LOAD_CMD = "load_image ${O}/${KERNEL_BIN_NAME} $(CONFIG_FLASH_BASE_ADDRESS)" OPENOCD_VERIFY_CMD = "verify_image ${O}/${KERNEL_BIN_NAME} $(CONFIG_FLASH_BASE_ADDRESS)" diff --git a/boards/arc/em_starterkit/Makefile.board b/boards/arc/em_starterkit/Makefile.board index 10e129b360c..4ee729b853b 100644 --- a/boards/arc/em_starterkit/Makefile.board +++ b/boards/arc/em_starterkit/Makefile.board @@ -6,7 +6,7 @@ #FLASH_SCRIPT = openocd.sh # ^^ Keep FLASH_SCRIPT undefined for now since flashing a self-boot image # is not yet supported by Zephyr Makefile. -OPENOCD_PRE_CMD = "-c targets 1" +OPENOCD_PRE_CMD = "targets 1" OPENOCD_LOAD_CMD = "load_image ${O}/${KERNEL_BIN_NAME} $(CONFIG_ICCM_BASE_ADDRESS)" OPENOCD_VERIFY_CMD = "verify_image ${O}/${KERNEL_BIN_NAME} $(CONFIG_ICCM_BASE_ADDRESS)" diff --git a/boards/arc/panther_ss/Makefile.board b/boards/arc/panther_ss/Makefile.board index 2c7ad79a9c4..e99bb120752 100644 --- a/boards/arc/panther_ss/Makefile.board +++ b/boards/arc/panther_ss/Makefile.board @@ -1,6 +1,6 @@ FLASH_SCRIPT = openocd.sh DEBUG_SCRIPT = openocd.sh -OPENOCD_PRE_CMD = "-c targets 1" +OPENOCD_PRE_CMD = "targets 1" OPENOCD_LOAD_CMD = "load_image ${O}/${KERNEL_BIN_NAME} $(CONFIG_FLASH_BASE_ADDRESS)" OPENOCD_VERIFY_CMD = "verify_image ${O}/${KERNEL_BIN_NAME} $(CONFIG_FLASH_BASE_ADDRESS)" diff --git a/boards/arc/quark_se_c1000_ss_devboard/Makefile.board b/boards/arc/quark_se_c1000_ss_devboard/Makefile.board index 2c7ad79a9c4..e99bb120752 100644 --- a/boards/arc/quark_se_c1000_ss_devboard/Makefile.board +++ b/boards/arc/quark_se_c1000_ss_devboard/Makefile.board @@ -1,6 +1,6 @@ FLASH_SCRIPT = openocd.sh DEBUG_SCRIPT = openocd.sh -OPENOCD_PRE_CMD = "-c targets 1" +OPENOCD_PRE_CMD = "targets 1" OPENOCD_LOAD_CMD = "load_image ${O}/${KERNEL_BIN_NAME} $(CONFIG_FLASH_BASE_ADDRESS)" OPENOCD_VERIFY_CMD = "verify_image ${O}/${KERNEL_BIN_NAME} $(CONFIG_FLASH_BASE_ADDRESS)" diff --git a/boards/x86/arduino_101/Makefile.board b/boards/x86/arduino_101/Makefile.board index 00ba144fd19..a7ef9587b97 100644 --- a/boards/x86/arduino_101/Makefile.board +++ b/boards/x86/arduino_101/Makefile.board @@ -8,7 +8,7 @@ else FLASH_SCRIPT = openocd.sh endif DEBUG_SCRIPT = openocd.sh -OPENOCD_PRE_CMD = "-c targets 1" +OPENOCD_PRE_CMD = "targets 1" OPENOCD_LOAD_CMD = "load_image ${O}/${KERNEL_BIN_NAME} ${CONFIG_PHYS_LOAD_ADDR}" OPENOCD_VERIFY_CMD = "verify_image ${O}/${KERNEL_BIN_NAME} ${CONFIG_PHYS_LOAD_ADDR}" diff --git a/boards/x86/panther/Makefile.board b/boards/x86/panther/Makefile.board index fd6d2f84b10..e79be2739f0 100644 --- a/boards/x86/panther/Makefile.board +++ b/boards/x86/panther/Makefile.board @@ -1,6 +1,6 @@ FLASH_SCRIPT = openocd.sh DEBUG_SCRIPT = openocd.sh -OPENOCD_PRE_CMD = "-c targets 1" +OPENOCD_PRE_CMD = "targets 1" OPENOCD_LOAD_CMD = "load_image ${O}/${KERNEL_BIN_NAME} ${CONFIG_PHYS_LOAD_ADDR}" OPENOCD_VERIFY_CMD = "verify_image ${O}/${KERNEL_BIN_NAME} ${CONFIG_PHYS_LOAD_ADDR}" diff --git a/boards/x86/quark_se_c1000_devboard/Makefile.board b/boards/x86/quark_se_c1000_devboard/Makefile.board index fd6d2f84b10..e79be2739f0 100644 --- a/boards/x86/quark_se_c1000_devboard/Makefile.board +++ b/boards/x86/quark_se_c1000_devboard/Makefile.board @@ -1,6 +1,6 @@ FLASH_SCRIPT = openocd.sh DEBUG_SCRIPT = openocd.sh -OPENOCD_PRE_CMD = "-c targets 1" +OPENOCD_PRE_CMD = "targets 1" OPENOCD_LOAD_CMD = "load_image ${O}/${KERNEL_BIN_NAME} ${CONFIG_PHYS_LOAD_ADDR}" OPENOCD_VERIFY_CMD = "verify_image ${O}/${KERNEL_BIN_NAME} ${CONFIG_PHYS_LOAD_ADDR}" diff --git a/scripts/support/openocd.sh b/scripts/support/openocd.sh index 6d8dd55aa29..55f0b0319b0 100755 --- a/scripts/support/openocd.sh +++ b/scripts/support/openocd.sh @@ -35,12 +35,12 @@ do_flash() { sh -c "${OPENOCD_CMD} -f '${OPENOCD_CONFIG}' \ -c 'init' \ -c 'targets' \ - ${OPENOCD_PRE_CMD} \ + ${OPENOCD_PRE_CMD:+-c $OPENOCD_PRE_CMD} \ -c 'reset halt' \ -c ${OPENOCD_LOAD_CMD} \ -c 'reset halt' \ -c ${OPENOCD_VERIFY_CMD} \ - ${OPENOCD_POST_CMD} \ + ${OPENOCD_POST_CMD:+-c $OPENOCD_POST_CMD} \ -c 'reset run' \ -c 'shutdown'" echo 'Done flashing'