diff --git a/hello_gradient/flash.sh b/hello_gradient/flash.sh new file mode 100755 index 0000000..8ef07d1 --- /dev/null +++ b/hello_gradient/flash.sh @@ -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/ diff --git a/hello_gradient/mnt/.gitignore b/hello_gradient/mnt/.gitignore new file mode 100644 index 0000000..e69de29