Skip to content

[linux] Create dfu-util script to select correct program (32/64-bit) #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions linux/dfu-util.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
#
# Use the correct dfu-util program based on the architecture
#

# Get the directory where the script is running.
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

# Choose dfu program by arch
if [ `uname -m` == "x86_64" ]; then
DFU_UTIL=${DIR}/dfu-util_x86_64/dfu-util
else
DFU_UTIL=${DIR}/dfu-util/dfu-util
fi

# Not found!
if [ ! -x "${DFU_UTIL}" ]; then
echo "$0: error: cannot find ${DFU_UTIL}" >&2
exit 2
fi

# Pass all parameters through
"${DFU_UTIL}" "$@"
Binary file modified linux/dfu-util/dfu-prefix
Binary file not shown.
Binary file modified linux/dfu-util/dfu-suffix
Binary file not shown.
Binary file modified linux/dfu-util/dfu-util
Binary file not shown.
13 changes: 1 addition & 12 deletions linux/maple_upload
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,7 @@ DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

"${DIR}/upload-reset" ${dummy_port_fullpath} 750

if [ `uname -m` == "x86_64" ]; then
DFU_UTIL=${DIR}/dfu-util_x86_64/dfu-util
else
DFU_UTIL=${DIR}/dfu-util/dfu-util
fi

if [ ! -x "${DFU_UTIL}" ]; then
echo "$0: error: cannot find ${DFU_UTIL}" >&2
exit 2
fi

"${DFU_UTIL}" -d ${usbID} -a ${altID} -D ${binfile} ${dfuse_addr} -R
"${DIR}/dfu-util.sh" -d ${usbID} -a ${altID} -D ${binfile} ${dfuse_addr} -R

echo -n Waiting for ${dummy_port_fullpath} serial...

Expand Down