diff --git a/.cargo/config b/.cargo/config index 81ca6e6..09114c0 100644 --- a/.cargo/config +++ b/.cargo/config @@ -2,6 +2,7 @@ target = "thumbv6m-none-eabi" [target.thumbv6m-none-eabi] +runner = "./flash.sh" rustflags = [ "-C", "link-arg=-Tlink.x", ] diff --git a/.gitignore b/.gitignore index 2c96eb1..681912b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ target/ Cargo.lock +firmware.bin diff --git a/flash.sh b/flash.sh new file mode 100755 index 0000000..d156d94 --- /dev/null +++ b/flash.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +binary="$1" +arm-none-eabi-objcopy -O binary "$binary" firmware.bin +sudo dfu-util -a 0 -s 0x08000000:leave -D firmware.bin