You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2019/11/08 15:50:38 UTC
[mynewt-core] branch master updated (5001bc2 -> f745b65)
This is an automated email from the ASF dual-hosted git repository.
andk pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git.
from 5001bc2 sys/console: Allow history to be preserved during reset
new acbec07 hw/scripts: Remove redundant port setting
new 223db47 hw/scripts: Add option for remote load/debug using J-Link
new 447709a hw/scripts: Change tabs to spaces
new f745b65 hw/bsp/dialog: Add support for load to remote GDB server
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../dialog_da1469x-dk-pro_download.sh | 9 ++-
hw/scripts/jlink.sh | 82 ++++++++++++++--------
2 files changed, 58 insertions(+), 33 deletions(-)
[mynewt-core] 01/04: hw/scripts: Remove redundant port setting
Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit acbec07bfeda99d267f10fb35753640c53a5a507
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Fri Nov 8 14:02:32 2019 +0100
hw/scripts: Remove redundant port setting
This is set to default value by parse_extra_jtag_cmd.
---
hw/scripts/jlink.sh | 1 -
1 file changed, 1 deletion(-)
diff --git a/hw/scripts/jlink.sh b/hw/scripts/jlink.sh
index 11c33be..5a2d1cc 100755
--- a/hw/scripts/jlink.sh
+++ b/hw/scripts/jlink.sh
@@ -27,7 +27,6 @@ JLINK_GDB_SERVER=JLinkGDBServer
jlink_load () {
GDB_CMD_FILE=.gdb_cmds
GDB_OUT_FILE=.gdb_out
- PORT=3333
windows_detect
parse_extra_jtag_cmd $EXTRA_JTAG_CMD
[mynewt-core] 04/04: hw/bsp/dialog: Add support for load to remote
GDB server
Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit f745b651f03581b8b16f2760123b355192768185
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Fri Nov 8 14:12:15 2019 +0100
hw/bsp/dialog: Add support for load to remote GDB server
Dialog BSP uses own code for loading image so needs to be updated
separately.
---
hw/bsp/dialog_da1469x-dk-pro/dialog_da1469x-dk-pro_download.sh | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/hw/bsp/dialog_da1469x-dk-pro/dialog_da1469x-dk-pro_download.sh b/hw/bsp/dialog_da1469x-dk-pro/dialog_da1469x-dk-pro_download.sh
index 73bfe1f..e8fd4f3 100755
--- a/hw/bsp/dialog_da1469x-dk-pro/dialog_da1469x-dk-pro_download.sh
+++ b/hw/bsp/dialog_da1469x-dk-pro/dialog_da1469x-dk-pro_download.sh
@@ -39,6 +39,7 @@ if [ "$MFG_IMAGE" ]; then
fi
parse_extra_jtag_cmd $EXTRA_JTAG_CMD
+jlink_target_cmd
GDB_CMD_FILE=.gdb_load
JLINK_LOG_FILE=.jlink_log
@@ -103,10 +104,14 @@ fi
FILE_SIZE=$(file_size $FILE_NAME)
+if [ -z $JLINK_TARGET_HOST ]; then
+ JLINK_SERVER_CMD="shell sh -c \"trap '' 2; $JLINK_GDB_SERVER -device cortex-m33 -speed 4000 -if SWD -port $PORT -singlerun $EXTRA_JTAG_CMD > $JLINK_LOG_FILE 2>&1 &\""
+fi
+
cat > $GDB_CMD_FILE <<EOF
set pagination off
-shell sh -c "trap '' 2; $JLINK_GDB_SERVER -device cortex-m33 -speed 4000 -if SWD -port $PORT -singlerun $EXTRA_JTAG_CMD > $JLINK_LOG_FILE 2>&1 &"
-target remote localhost:$PORT
+$JLINK_SERVER_CMD
+$JLINK_TARGET_CMD
mon reset
mon halt
restore $FLASH_LOADER.bin binary 0x20000000
[mynewt-core] 03/04: hw/scripts: Change tabs to spaces
Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit 447709ada19702571b6bcff6d167e467cfd8464c
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Fri Nov 8 14:06:19 2019 +0100
hw/scripts: Change tabs to spaces
---
hw/scripts/jlink.sh | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/hw/scripts/jlink.sh b/hw/scripts/jlink.sh
index b3471dc..569839a 100755
--- a/hw/scripts/jlink.sh
+++ b/hw/scripts/jlink.sh
@@ -48,17 +48,17 @@ jlink_load () {
jlink_target_cmd
if [ $WINDOWS -eq 1 ]; then
- JLINK_GDB_SERVER=JLinkGDBServerCL
+ JLINK_GDB_SERVER=JLinkGDBServerCL
fi
if [ -z $FILE_NAME ]; then
echo "Missing filename"
exit 1
fi
if [ ! -f "$FILE_NAME" ]; then
- # tries stripping current path for readability
+ # tries stripping current path for readability
FILE=${FILE_NAME##$(pwd)/}
- echo "Cannot find file" $FILE
- exit 1
+ echo "Cannot find file" $FILE
+ exit 1
fi
if [ -z $FLASH_OFFSET ]; then
echo "Missing flash offset"
@@ -102,22 +102,22 @@ jlink_load () {
error=`echo $msgs | grep error`
if [ -n "$error" ]; then
- exit 1
+ exit 1
fi
error=`echo $msgs | grep -i failed`
if [ -n "$error" ]; then
- exit 1
+ exit 1
fi
error=`echo $msgs | grep -i "unknown / supported"`
if [ -n "$error" ]; then
- exit 1
+ exit 1
fi
error=`echo $msgs | grep -i "not found"`
if [ -n "$error" ]; then
- exit 1
+ exit 1
fi
return 0
@@ -133,7 +133,7 @@ jlink_load () {
jlink_debug() {
windows_detect
if [ $WINDOWS -eq 1 ]; then
- JLINK_GDB_SERVER=JLinkGDBServerCL
+ JLINK_GDB_SERVER=JLinkGDBServerCL
fi
parse_extra_jtag_cmd $EXTRA_JTAG_CMD
jlink_target_cmd
@@ -177,13 +177,13 @@ jlink_debug() {
fi
echo "$EXTRA_GDB_CMDS" >> $GDB_CMD_FILE
- if [ $WINDOWS -eq 1 ]; then
- FILE_NAME=`echo $FILE_NAME | sed 's/\//\\\\/g'`
- $COMSPEC /C "start $COMSPEC /C arm-none-eabi-gdb -x $GDB_CMD_FILE $FILE_NAME"
- else
+ if [ $WINDOWS -eq 1 ]; then
+ FILE_NAME=`echo $FILE_NAME | sed 's/\//\\\\/g'`
+ $COMSPEC /C "start $COMSPEC /C arm-none-eabi-gdb -x $GDB_CMD_FILE $FILE_NAME"
+ else
arm-none-eabi-gdb -x $GDB_CMD_FILE $FILE_NAME
rm $GDB_CMD_FILE
- fi
+ fi
else
$JLINK_GDB_SERVER -device $JLINK_DEV -speed 4000 -if SWD -port $PORT -singlerun $EXTRA_JTAG_CMD
fi
[mynewt-core] 02/04: hw/scripts: Add option for remote load/debug
using J-Link
Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit 223db47c3bf0e8b07239ba347b915fff1e7d5354
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Fri Nov 8 14:03:11 2019 +0100
hw/scripts: Add option for remote load/debug using J-Link
This adds support for JLINK_REMOTE env to specify remote JLinkGDBServer
instance to connect to. If specified (as 'host:port' or just 'host' to
use default 2331 port), both 'load' and 'debug' won't spawn local server
process and will instead try to connect to specified one.
---
hw/scripts/jlink.sh | 53 +++++++++++++++++++++++++++++++++++++----------------
1 file changed, 37 insertions(+), 16 deletions(-)
diff --git a/hw/scripts/jlink.sh b/hw/scripts/jlink.sh
index 5a2d1cc..b3471dc 100755
--- a/hw/scripts/jlink.sh
+++ b/hw/scripts/jlink.sh
@@ -19,6 +19,21 @@
JLINK_GDB_SERVER=JLinkGDBServer
+jlink_target_cmd () {
+ if [ -z $JLINK_REMOTE ]; then
+ JLINK_TARGET_CMD="target remote localhost:$PORT"
+ else
+ JLINK_TARGET_HOST=`echo $JLINK_REMOTE | cut -d : -f 1 -s`
+ if [ -z $JLINK_TARGET_HOST ]; then
+ JLINK_TARGET_HOST=$JLINK_REMOTE
+ JLINK_TARGET_PORT=2331
+ else
+ JLINK_TARGET_PORT=`echo $JLINK_REMOTE | cut -d : -f 2`
+ fi
+ JLINK_TARGET_CMD="target remote $JLINK_TARGET_HOST:$JLINK_TARGET_PORT"
+ fi
+}
+
#
# FILE_NAME is the file to load
# FLASH_OFFSET is location in the flash
@@ -30,6 +45,7 @@ jlink_load () {
windows_detect
parse_extra_jtag_cmd $EXTRA_JTAG_CMD
+ jlink_target_cmd
if [ $WINDOWS -eq 1 ]; then
JLINK_GDB_SERVER=JLinkGDBServerCL
@@ -55,8 +71,10 @@ jlink_load () {
# downloading somewhere in the flash. So need to figure out how to tell it
# not to do that, or report failure if gdb fails to write this file
#
- echo "shell sh -c \"trap '' 2; $JLINK_GDB_SERVER -device $JLINK_DEV -speed 1000 -if SWD -port $PORT -singlerun $EXTRA_JTAG_CMD &\" " > $GDB_CMD_FILE
- echo "target remote localhost:$PORT" >> $GDB_CMD_FILE
+ if [ -z $JLINK_TARGET_HOST]; then
+ echo "shell sh -c \"trap '' 2; $JLINK_GDB_SERVER -device $JLINK_DEV -speed 1000 -if SWD -port $PORT -singlerun $EXTRA_JTAG_CMD &\" " > $GDB_CMD_FILE
+ fi
+ echo "$JLINK_TARGET_CMD" >> $GDB_CMD_FILE
echo "mon reset" >> $GDB_CMD_FILE
echo "restore $FILE_NAME binary $FLASH_OFFSET" >> $GDB_CMD_FILE
@@ -118,6 +136,7 @@ jlink_debug() {
JLINK_GDB_SERVER=JLinkGDBServerCL
fi
parse_extra_jtag_cmd $EXTRA_JTAG_CMD
+ jlink_target_cmd
if [ -z "$NO_GDB" ]; then
GDB_CMD_FILE=.gdb_cmds
@@ -133,22 +152,24 @@ jlink_debug() {
echo "Debugging" $FILE_NAME
- if [ $WINDOWS -eq 1 ]; then
- #
- # Launch jlink server in a separate command interpreter, to make
- # sure it doesn't get killed by Ctrl-C signal from bash.
- #
- $COMSPEC /C "start $COMSPEC /C $JLINK_GDB_SERVER -device $JLINK_DEV -speed 4000 -if SWD -port $PORT -singlerun $EXTRA_JTAG_CMD"
- else
- #
- # Block Ctrl-C from getting passed to jlink server.
- #
- set -m
- $JLINK_GDB_SERVER -device $JLINK_DEV -speed 4000 -if SWD -port $PORT -singlerun $EXTRA_JTAG_CMD > /dev/null &
- set +m
+ if [ -z $JLINK_TARGET_HOST]; then
+ if [ $WINDOWS -eq 1 ]; then
+ #
+ # Launch jlink server in a separate command interpreter, to make
+ # sure it doesn't get killed by Ctrl-C signal from bash.
+ #
+ $COMSPEC /C "start $COMSPEC /C $JLINK_GDB_SERVER -device $JLINK_DEV -speed 4000 -if SWD -port $PORT -singlerun $EXTRA_JTAG_CMD"
+ else
+ #
+ # Block Ctrl-C from getting passed to jlink server.
+ #
+ set -m
+ $JLINK_GDB_SERVER -device $JLINK_DEV -speed 4000 -if SWD -port $PORT -singlerun $EXTRA_JTAG_CMD > /dev/null &
+ set +m
+ fi
fi
- echo "target remote localhost:$PORT" > $GDB_CMD_FILE
+ echo "$JLINK_TARGET_CMD" > $GDB_CMD_FILE
# Whether target should be reset or not
if [ ! -z "$RESET" ]; then
echo "mon reset" >> $GDB_CMD_FILE