From dbfb0ea76aaafce99f7c2c229a0ab76f45b68e9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20H=C3=BC=C3=9Fler?= Date: Fri, 9 Jun 2023 23:49:35 +0200 Subject: [PATCH] dist/tools/openocd: add RTT port variable --- dist/tools/openocd/openocd.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dist/tools/openocd/openocd.sh b/dist/tools/openocd/openocd.sh index 1bd5d09a3e..91b0bf554e 100755 --- a/dist/tools/openocd/openocd.sh +++ b/dist/tools/openocd/openocd.sh @@ -73,6 +73,9 @@ # # term-rtt: opens a serial terminal using RTT (Real-Time Transfer) # +# +# RTT_PORT: port opened for RTT connection +# # @author Hauke Peteresen # @author Joakim NohlgÄrd @@ -84,6 +87,8 @@ : ${TELNET_PORT:=4444} # Default TCL port, set to 0 to disable : ${TCL_PORT:=6333} +# Default RTT port +: ${RTT_PORT:=9999} # Default OpenOCD command : ${OPENOCD:=openocd} # Extra board initialization commands to pass to OpenOCD @@ -132,7 +137,7 @@ # default terminal frontend _OPENOCD_TERMPROG=${RIOTTOOLS}/pyterm/pyterm -_OPENOCD_TERMFLAGS="-ts 9999 ${PYTERMFLAGS}" +_OPENOCD_TERMFLAGS="-ts ${RTT_PORT} ${PYTERMFLAGS}" # # Examples of alternative debugger configurations @@ -449,7 +454,7 @@ do_term() { -c init \ -c 'rtt setup '${RAM_START_ADDR}' '${RAM_LEN}' \"SEGGER RTT\"' \ -c 'rtt start' \ - -c 'rtt server start 9999 0' \ + -c 'rtt server start '${RTT_PORT}' 0' \ >/dev/null & \ echo \$! > $OPENOCD_PIDFILE" & sleep 1