2019-11-23 22:48:16 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2019-11-24 00:18:42 +00:00
|
|
|
cargo build --release --features $1
|
|
|
|
|
|
|
|
APPLET=harrogate
|
2019-11-23 22:48:16 +00:00
|
|
|
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/
|