Skip to content

Commit 3b2c87d

Browse files
Updated linux tools to contain upload-reset (bin) utility, and modified maple-upload script to use this utility to reset the bootloader prior to upload. Also changed maple-upload so that it uses the pre-compiled dfu-util binary that is now part of the repo
1 parent 69420b4 commit 3b2c87d

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

drivers/linux/install-udev-rules.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ if sudo [ -w /etc/udev/rules.d ]; then
55
sudo cp -v 45-maple.rules /etc/udev/rules.d/45-maple.rules
66
sudo chown root:root /etc/udev/rules.d/45-maple.rules
77
sudo chmod 644 /etc/udev/rules.d/45-maple.rules
8+
echo "Reloading udev rules"
9+
sudo udevadm control --reload-rules
810
else
911
echo "Couldn't copy to /etc/udev/rules.d/; you probably have to run this script as root? Or your distribution of Linux doesn't include udev; try running the IDE itself as root."
1012
fi
13+

tools/linux/maple_upload

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,37 @@
11
#!/bin/bash
22

3-
set -e
3+
#set -e
4+
5+
46

57
if [ $# -lt 4 ]; then
68
echo "Usage: $0 $# <dummy_port> <altID> <usbID> <binfile>" >&2
79
exit 1
810
fi
9-
dummy_port=$1; altID=$2; usbID=$3; binfile=$4;
11+
dummy_port=$1; altID=$2; usbID=$3; binfile=$4; dummy_port_fullpath="/dev/$1"
1012
if [ $# -eq 5 ]; then
1113
dfuse_addr="--dfuse-address $5"
1214
else
1315
dfuse_addr=""
1416
fi
1517

18+
19+
# Get the directory where the script is running.
20+
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
21+
22+
# ----------------- IMPORTANT -----------------
23+
# The 2nd parameter to upload-reset is the delay after resetting before it exits
24+
# This value is in milliseonds
25+
# You may need to tune this to your system
26+
# 750ms to 1500ms seems to work on my Mac
27+
28+
29+
${DIR}/upload-reset ${dummy_port_fullpath} 750
30+
31+
1632
#DFU_UTIL=$(dirname $0)/dfu-util/dfu-util
1733
DFU_UTIL=/usr/bin/dfu-util
34+
DFU_UTIL=${DIR}/dfu-util/dfu-util
1835
if [ ! -x ${DFU_UTIL} ]; then
1936
echo "$0: error: cannot find ${DFU_UTIL}" >&2
2037
exit 2

tools/linux/upload-reset

7.76 KB
Binary file not shown.

0 commit comments

Comments
 (0)