aboutsummaryrefslogtreecommitdiff
path: root/Arduino_STM32-MIDI/tools/linux/maple_upload
blob: eb8e3ba74260d8844b64e314b4163e8030781661 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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=/usr/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}