save script to automate flashing commands

This commit is contained in:
Tangent 128 2019-10-26 22:46:01 -04:00
parent 04df6a68ff
commit 8171494cce
2 changed files with 20 additions and 0 deletions

20
hello_gradient/flash.sh Executable file
View file

@ -0,0 +1,20 @@
#!/bin/sh
set -e
APPLET=$1
TARGET_BIN="target/thumbv6m-none-eabi/release/$APPLET"
test -e "$TARGET_BIN" || {
echo "'$APPLET' does not exist"
exit 1
}
arm-none-eabi-objcopy -O binary "$TARGET_BIN" flash.bin
uf2conv-rs flash.bin -o flash.uf2
sudo mount LABEL=ITSYBOOT mnt/
echo "Flashing..."
sudo cp flash.uf2 mnt/flash.uf2
sync
echo "Done."
sudo umount mnt/

0
hello_gradient/mnt/.gitignore vendored Normal file
View file