From 91f01c0b6246c692661d64b4b65418a3f35a4769 Mon Sep 17 00:00:00 2001 From: foosinn Date: Sat, 10 Jul 2021 23:56:43 +0200 Subject: [PATCH] add runner scrip to allow cargo run --- .cargo/config | 1 + .gitignore | 1 + flash.sh | 5 +++++ 3 files changed, 7 insertions(+) create mode 100755 flash.sh 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