2019-11-23 22:48:16 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2021-07-05 00:30:27 +00:00
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2021-07-05 00:30:27 +00:00
|
|
|
arm-none-eabi-objcopy -O binary "$TARGET_BIN" image.bin
|
|
|
|
uf2conv-rs image.bin -o image.uf2
|
2019-11-23 22:48:16 +00:00
|
|
|
|
|
|
|
sudo mount LABEL=ITSYBOOT mnt/
|
|
|
|
echo "Flashing..."
|
2021-07-05 00:30:27 +00:00
|
|
|
sudo cp image.uf2 mnt/image.uf2
|
2019-11-23 22:48:16 +00:00
|
|
|
sync
|
|
|
|
echo "Done."
|
|
|
|
sudo umount mnt/
|