You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ut...@apache.org on 2019/01/04 14:08:11 UTC

[mynewt-core] 01/02: Avoid resetting target when debugging with st-util

This is an automated email from the ASF dual-hosted git repository.

utzig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 7ef601d25a260b346ab4ef181e2654abd05f8c61
Author: Fabio Utzig <ut...@apache.org>
AuthorDate: Thu Jan 3 11:39:26 2019 -0200

    Avoid resetting target when debugging with st-util
    
    The default behaviour for st-util is to reset the target on startup,
    which should only be done when RESET shell variable is set.
    
    Signed-off-by: Fabio Utzig <ut...@apache.org>
---
 hw/scripts/stlink.sh | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/hw/scripts/stlink.sh b/hw/scripts/stlink.sh
index 29d97c8..708e048 100755
--- a/hw/scripts/stlink.sh
+++ b/hw/scripts/stlink.sh
@@ -41,7 +41,7 @@ stlink_load () {
 
     echo "Downloading" $FILE_NAME "to" $FLASH_OFFSET
 
-    st-flash --reset write $FILE_NAME $FLASH_OFFSET 
+    st-flash --reset write $FILE_NAME $FLASH_OFFSET
     if [ $? -ne 0 ]; then
         exit 1
     fi
@@ -56,6 +56,8 @@ stlink_debug () {
     windows_detect
     PORT=3333
 
+    parse_extra_jtag_cmd $EXTRA_JTAG_CMD
+
     if [ -z "$NO_GDB" ]; then
         if [ -z $FILE_NAME ]; then
             echo "Missing filename"
@@ -72,13 +74,13 @@ stlink_debug () {
             # it doesn't get killed by Ctrl-C signal from bash.
             #
 
-            $COMSPEC /C "start $COMSPEC /C st-util -p $PORT"
+            $COMSPEC /C "start $COMSPEC /C st-util --no-reset -p $PORT"
         else
             #
             # Block Ctrl-C from getting passed to openocd.
             #
             set -m
-            st-util -p $PORT >stlink.log 2>&1 & 
+            st-util --no-reset -p $PORT >stlink.log 2>&1 &
             stpid=$!
             set +m
         fi
@@ -106,8 +108,8 @@ stlink_debug () {
             fi
         fi
     else
-        # No GDB, wait for openocd to exit
-        st-util -p $PORT 
+        # No GDB, wait for st-util to exit
+        st-util --no-reset -p $PORT
         return $?
     fi