microduino: Add OS X version of maple_upload script

Currently this is a wrapper around dfu-util; tested with
dfu-util-0.7.mpkg, e.g.
https://code.google.com/p/companion9x/downloads/detail?name=dfu-util-0.7.mpkg
This commit is contained in:
Ian Harvey 2014-12-23 15:46:14 +00:00
parent 5546e20d0c
commit 9de8d1d058
3 changed files with 20 additions and 1 deletions

View File

@ -324,7 +324,7 @@ microduino32_flash.upload.file_type=bin
microduino32_flash.upload.ram.maximum_size=17000
microduino32_flash.upload.flash.maximum_size=108000
microduino32_flash.upload.usbID=1EAF:0003
microduino32_flash.upload.altID=0
microduino32_flash.upload.altID=1
microduino32_flash.upload.auto_reset=true

View File

@ -97,10 +97,12 @@ recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).*
# Uploader tools
# -------------------
# Upload using Maple bootloader over DFU
tools.maple_upload.cmd=maple_upload
tools.maple_upload.cmd.windows=maple_upload.bat
#tools.maple_upload.cmd.linux=
tools.maple_upload.path={runtime.hardware.path}/tools/win
tools.maple_upload.path.macosx={runtime.hardware.path}/tools/macosx
tools.maple_upload.upload.params.verbose=-d
tools.maple_upload.upload.params.quiet=

17
tools/macosx/maple_upload Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
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
DFU_UTIL=/opt/local/bin/dfu-util
if [ ! -x ${DFU_UTIL} ]; then
echo "$0: error: cannot find ${DFU_UTIL}" >&2
exit 2
fi
${DFU_UTIL} -d ${usbID} -a ${altID} -D ${binfile}