From ce6ad70c068700a56df95b94767f5b5483c818f9 Mon Sep 17 00:00:00 2001 From: Piotr Mienkowski Date: Fri, 31 Mar 2017 15:12:59 +0200 Subject: [PATCH] scripts: openocd.sh: align usage of OPENOCD_*_CMD variables OPENOCD_PRE_CMD, OPENOCD_POST_CMD variables require adding '-c' in front of an actual OpenOCD command. This is in contrary to other OPENOCD_*_CMD varialbles which specify OpenOCD commands directly. This patch aligns usage of various OPENOCD_*_CMD variables. It is no longer required to add '-c' in front of OPENOCD_PRE_CMD, OPENOCD_POST_CMD variables. Change-Id: I276fab00b099694c83c3bf74aa5dd59c8d6a308b Signed-off-by: Piotr Mienkowski --- boards/arc/arduino_101_sss/Makefile.board | 2 +- boards/arc/em_starterkit/Makefile.board | 2 +- boards/arc/panther_ss/Makefile.board | 2 +- boards/arc/quark_se_c1000_ss_devboard/Makefile.board | 2 +- boards/x86/arduino_101/Makefile.board | 2 +- boards/x86/panther/Makefile.board | 2 +- boards/x86/quark_se_c1000_devboard/Makefile.board | 2 +- scripts/support/openocd.sh | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) 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'