summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Lassieur <clement.lassieur@parrot.com>2019-05-20 16:23:26 +0200
committerClément Lassieur <clement.lassieur@parrot.com>2019-05-31 16:37:40 +0200
commite428050c91ecdea7200062d30fb412189e79b5a9 (patch)
tree1d9b48da8cceb31857ba93e66c4414b0c62335fa
parent29d45d938171ffa0e3a4ae52abd58af1e6c16e76 (diff)
downloademacs-e428050c91ecdea7200062d30fb412189e79b5a9.tar.gz
bin: add jlink scripts
-rwxr-xr-xbin/my-jlink7
-rwxr-xr-xbin/my-jlink-flash17
-rwxr-xr-xbin/my-jlink-read18
-rwxr-xr-xbin/my-jlink-rtt14
4 files changed, 56 insertions, 0 deletions
diff --git a/bin/my-jlink b/bin/my-jlink
new file mode 100755
index 0000000..838b823
--- /dev/null
+++ b/bin/my-jlink
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+exec /usr/bin/JLinkExe \
+ -device STM32F405RG \
+ -if SWD \
+ -speed 20000 \
+ -autoconnect 1
diff --git a/bin/my-jlink-flash b/bin/my-jlink-flash
new file mode 100755
index 0000000..ae39c21
--- /dev/null
+++ b/bin/my-jlink-flash
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+FILE=/tmp/`basename $0`-tmp-file
+BIN=/tmp/guix-build-remote-1.0.drv-0/build/zephyr/zephyr.bin
+
+echo r > $FILE
+echo "loadbin $BIN 0x00000000" >> $FILE
+echo r >> $FILE
+echo g >> $FILE
+echo qc >> $FILE
+
+/usr/bin/JLinkExe \
+ -device STM32F405RG \
+ -if SWD \
+ -speed 20000 \
+ -autoconnect 1 \
+ -CommandFile $FILE
diff --git a/bin/my-jlink-read b/bin/my-jlink-read
new file mode 100755
index 0000000..68c106b
--- /dev/null
+++ b/bin/my-jlink-read
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# usage: my-jlink-read 0x08080000 200
+
+FILE=/tmp/`basename $0`-tmp-file
+OUTFILE=/tmp/`basename $0`-tmp-file-out
+
+echo "savebin $OUTFILE $1 $2" > $FILE
+echo "q" >> $FILE
+
+/usr/bin/JLinkExe \
+ -device STM32F405RG \
+ -if SWD \
+ -speed 20000 \
+ -autoconnect 1 \
+ -CommandFile $FILE
+
+hexdump -C $OUTFILE
diff --git a/bin/my-jlink-rtt b/bin/my-jlink-rtt
new file mode 100755
index 0000000..a3221ee
--- /dev/null
+++ b/bin/my-jlink-rtt
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+FILE=/tmp/`basename $0`-tmp-file
+
+echo "exec SetRTTAddr 0x2000a138" > $FILE
+
+/usr/bin/JLinkExe \
+ -device CORTEX-M4 \
+ -if SWD \
+ -speed 4000 \
+ -autoconnect 1 \
+ -CommandFile $FILE
+
+# and then JLinkRTTClient or telnet localhost 19021