Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
8a9a31e5
Commit
8a9a31e5
authored
Mar 17, 2014
by
Damien George
Browse files
stmhal: Add autoflash script, to flash a DFU device automatically.
parent
fb431bf5
Changes
1
Hide whitespace changes
Inline
Side-by-side
stmhal/autoflash
0 → 100755
View file @
8a9a31e5
#!/bin/sh
#
# this script waits for a DFU device to be attached and then flashes it
# it then waits until the DFU mode is exited, and then loops
while
true
;
do
echo
"waiting for DFU device..."
while
true
;
do
if
lsusb |
grep
-q
DFU
;
then
break
fi
sleep
1s
done
echo
"found DFU device, flashing"
dfu-util
-a
0
-D
build/flash.dfu
echo
"waiting for DFU to exit..."
while
true
;
do
if
lsusb |
grep
-q
DFU
;
then
sleep
1s
continue
fi
break
done
done
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment