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
This commit is contained in:
parent
69420b429b
commit
3b2c87de5a
|
@ -5,6 +5,9 @@ if sudo [ -w /etc/udev/rules.d ]; then
|
|||
sudo cp -v 45-maple.rules /etc/udev/rules.d/45-maple.rules
|
||||
sudo chown root:root /etc/udev/rules.d/45-maple.rules
|
||||
sudo chmod 644 /etc/udev/rules.d/45-maple.rules
|
||||
echo "Reloading udev rules"
|
||||
sudo udevadm control --reload-rules
|
||||
else
|
||||
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."
|
||||
fi
|
||||
|
||||
|
|
|
@ -1,20 +1,37 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
#set -e
|
||||
|
||||
|
||||
|
||||
if [ $# -lt 4 ]; then
|
||||
echo "Usage: $0 $# <dummy_port> <altID> <usbID> <binfile>" >&2
|
||||
exit 1
|
||||
fi
|
||||
dummy_port=$1; altID=$2; usbID=$3; binfile=$4;
|
||||
dummy_port=$1; altID=$2; usbID=$3; binfile=$4; dummy_port_fullpath="/dev/$1"
|
||||
if [ $# -eq 5 ]; then
|
||||
dfuse_addr="--dfuse-address $5"
|
||||
else
|
||||
dfuse_addr=""
|
||||
fi
|
||||
|
||||
|
||||
# Get the directory where the script is running.
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
|
||||
# ----------------- IMPORTANT -----------------
|
||||
# The 2nd parameter to upload-reset is the delay after resetting before it exits
|
||||
# This value is in milliseonds
|
||||
# You may need to tune this to your system
|
||||
# 750ms to 1500ms seems to work on my Mac
|
||||
|
||||
|
||||
${DIR}/upload-reset ${dummy_port_fullpath} 750
|
||||
|
||||
|
||||
#DFU_UTIL=$(dirname $0)/dfu-util/dfu-util
|
||||
DFU_UTIL=/usr/bin/dfu-util
|
||||
DFU_UTIL=${DIR}/dfu-util/dfu-util
|
||||
if [ ! -x ${DFU_UTIL} ]; then
|
||||
echo "$0: error: cannot find ${DFU_UTIL}" >&2
|
||||
exit 2
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue