From 92e6731824cf4286136cb343d538aae4f772fe13 Mon Sep 17 00:00:00 2001
From: Uros Majstorovic <majstor@majstor.org>
Date: Sun, 4 Sep 2022 18:09:35 +0200
Subject: upload script fixed for jlink

---
 fw/fe310/bsp/upload | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'fw/fe310/bsp/upload')

diff --git a/fw/fe310/bsp/upload b/fw/fe310/bsp/upload
index a52fc0a..120a72a 100755
--- a/fw/fe310/bsp/upload
+++ b/fw/fe310/bsp/upload
@@ -14,7 +14,8 @@ do
     case "$1"
     in
     --elf)                 elf="$2";     shift 2;;
-    --hex)                 hex="$2";     shift 2;;
+    --bin)                 bin="$2";     shift 2;;
+    --addr)                addr="$2";    shift 2;;
     --openocd)             openocd="$2"; shift 2;;
     --openocd-config)      cfg="$2";     shift 2;;
     --jlink)               jlink="$2";   shift 2;;
@@ -23,9 +24,9 @@ do
     esac
 done
 
-if [ "$elf" == "" -a "$hex" == "" ]
+if [ "$elf" == "" -a "$bin" == "" ]
 then
-    echo "$0: --elf or --hex is required" >&2
+    echo "$0: --elf or --bin is required" >&2
     exit 1
 fi
 
@@ -34,7 +35,7 @@ export GDB_PORT=3333
 if [ "$jlink" != "" ]
 then
 
-echo -e "loadfile $hex\nrnh\nexit" | $jlink -device FE310 -if JTAG -speed 4000 -jtagconf -1,-1 -autoconnect 1
+echo -e "loadfile $bin $addr\nrnh\nexit" | $jlink -device FE310 -if JTAG -speed 4000 -jtagconf -1,-1 -autoconnect 1
 
 else
 
-- 
cgit v1.2.3