Repository: incubator-mynewt-core Updated Branches: refs/heads/develop 8ff24d5ae -> 55c4bff2f
Fix openocd 'cpu not halted' error on detach Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/dd92a467 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/dd92a467 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/dd92a467 Branch: refs/heads/develop Commit: dd92a467718accf63d0c82f2b551e8d1eff05b8a Parents: 73418c7 Author: Simon Ratner <[email protected]> Authored: Wed Dec 28 16:18:59 2016 -0800 Committer: Simon Ratner <[email protected]> Committed: Wed Dec 28 16:18:59 2016 -0800 ---------------------------------------------------------------------- hw/bsp/arduino_primo_nrf52/primo_debug.sh | 3 ++- hw/bsp/nrf51-blenano/nrf51dk_debug.sh | 3 ++- hw/bsp/nucleo-f401re/nucleo-f401re_debug.sh | 2 +- .../olimex_stm32-e407_devboard_debug.sh | 2 +- hw/bsp/rb-nano2/rb-nano2_debug.sh | 3 ++- hw/bsp/stm32f4discovery/stm32f4discovery_debug.sh | 3 ++- 6 files changed, 10 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd92a467/hw/bsp/arduino_primo_nrf52/primo_debug.sh ---------------------------------------------------------------------- diff --git a/hw/bsp/arduino_primo_nrf52/primo_debug.sh b/hw/bsp/arduino_primo_nrf52/primo_debug.sh index 2ed8972..9aa7f45 100755 --- a/hw/bsp/arduino_primo_nrf52/primo_debug.sh +++ b/hw/bsp/arduino_primo_nrf52/primo_debug.sh @@ -42,7 +42,8 @@ if [ $USE_OPENOCD -eq 1 ]; then . $CORE_PATH/hw/scripts/openocd.sh CFG="-s $BSP_PATH -f arduino_primo.cfg" - EXTRA_JTAG_CMD="$EXTRA_JTAG_CMD; nrf52.cpu configure -event gdb-detach {resume;shutdown}" + # Exit openocd when gdb detaches. + EXTRA_JTAG_CMD="$EXTRA_JTAG_CMD; nrf52.cpu configure -event gdb-detach {if {[nrf52.cpu curstate] eq \"halted\"} resume;shutdown}" openocd_debug else http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd92a467/hw/bsp/nrf51-blenano/nrf51dk_debug.sh ---------------------------------------------------------------------- diff --git a/hw/bsp/nrf51-blenano/nrf51dk_debug.sh b/hw/bsp/nrf51-blenano/nrf51dk_debug.sh index 10e8408..7f4d2d5 100755 --- a/hw/bsp/nrf51-blenano/nrf51dk_debug.sh +++ b/hw/bsp/nrf51-blenano/nrf51dk_debug.sh @@ -31,6 +31,7 @@ FILE_NAME=$BIN_BASENAME.elf CFG="-f interface/cmsis-dap.cfg -f target/nrf51.cfg" -EXTRA_JTAG_CMD="$EXTRA_JTAG_CMD; nrf51.cpu configure -event gdb-detach {resume;shutdown}" +# Exit openocd when gdb detaches. +EXTRA_JTAG_CMD="$EXTRA_JTAG_CMD; nrf51.cpu configure -event gdb-detach {if {[nrf51.cpu curstate] eq \"halted\"} resume;shutdown}" openocd_debug http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd92a467/hw/bsp/nucleo-f401re/nucleo-f401re_debug.sh ---------------------------------------------------------------------- diff --git a/hw/bsp/nucleo-f401re/nucleo-f401re_debug.sh b/hw/bsp/nucleo-f401re/nucleo-f401re_debug.sh index 1ecd260..11d2fe5 100755 --- a/hw/bsp/nucleo-f401re/nucleo-f401re_debug.sh +++ b/hw/bsp/nucleo-f401re/nucleo-f401re_debug.sh @@ -32,6 +32,6 @@ FILE_NAME=$BIN_BASENAME.elf CFG="-f board/st_nucleo_f4.cfg" # Exit openocd when gdb detaches. -EXTRA_JTAG_CMD="$EXTRA_JTAG_CMD; stm32f4x.cpu configure -event gdb-detach {resume;shutdown}" +EXTRA_JTAG_CMD="$EXTRA_JTAG_CMD; stm32f4x.cpu configure -event gdb-detach {if {[stm32f4x.cpu curstate] eq \"halted\"} resume;shutdown}" openocd_debug http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd92a467/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_debug.sh ---------------------------------------------------------------------- diff --git a/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_debug.sh b/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_debug.sh index 2d8c83e..70e16df 100755 --- a/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_debug.sh +++ b/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_debug.sh @@ -32,6 +32,6 @@ FILE_NAME=$BIN_BASENAME.elf CFG="-f interface/ftdi/olimex-arm-usb-tiny-h.cfg -s $BSP_PATH -f f407.cfg" # Exit openocd when gdb detaches. -EXTRA_JTAG_CMD="$EXTRA_JTAG_CMD; stm32f4x.cpu configure -event gdb-detach {resume;shutdown}" +EXTRA_JTAG_CMD="$EXTRA_JTAG_CMD; stm32f4x.cpu configure -event gdb-detach {if {[stm32f4x.cpu curstate] eq \"halted\"} resume;shutdown}" openocd_debug http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd92a467/hw/bsp/rb-nano2/rb-nano2_debug.sh ---------------------------------------------------------------------- diff --git a/hw/bsp/rb-nano2/rb-nano2_debug.sh b/hw/bsp/rb-nano2/rb-nano2_debug.sh index 8cd53c8..2f760cb 100755 --- a/hw/bsp/rb-nano2/rb-nano2_debug.sh +++ b/hw/bsp/rb-nano2/rb-nano2_debug.sh @@ -31,7 +31,8 @@ FILE_NAME=$BIN_BASENAME.elf CFG="-f interface/cmsis-dap.cfg -f target/nrf52.cfg" -EXTRA_JTAG_CMD="$EXTRA_JTAG_CMD; nrf52.cpu configure -event gdb-detach {resume;shutdown}" +# Exit openocd when gdb detaches. +EXTRA_JTAG_CMD="$EXTRA_JTAG_CMD; nrf52.cpu configure -event gdb-detach {if {[nrf52.cpu curstate] eq \"halted\"} resume;shutdown}" openocd_debug http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/dd92a467/hw/bsp/stm32f4discovery/stm32f4discovery_debug.sh ---------------------------------------------------------------------- diff --git a/hw/bsp/stm32f4discovery/stm32f4discovery_debug.sh b/hw/bsp/stm32f4discovery/stm32f4discovery_debug.sh index 1a95b3e..c78aad8 100755 --- a/hw/bsp/stm32f4discovery/stm32f4discovery_debug.sh +++ b/hw/bsp/stm32f4discovery/stm32f4discovery_debug.sh @@ -31,6 +31,7 @@ FILE_NAME=$BIN_BASENAME.elf CFG="-s $BSP_PATH -f $BSP_PATH/f4discovery.cfg" -EXTRA_JTAG_CMD="$EXTRA_JTAG_CMD; stm32f4x.cpu configure -event gdb-detach {resume;shutdown}" +# Exit openocd when gdb detaches. +EXTRA_JTAG_CMD="$EXTRA_JTAG_CMD; stm32f4x.cpu configure -event gdb-detach {if {[stm32f4x.cpu curstate] eq \"halted\"} resume;shutdown}" openocd_debug
