-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjustfile
39 lines (27 loc) · 775 Bytes
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name := "blink"
build := "debug" # debug | release
elf_target := "target" / "thumbv7m-none-eabi" / build / name
bin_target := "target" / name + ".bin"
cargo_build_flags := if build == "release" { "--release" } else { "" }
build: fmt
cargo build {{cargo_build_flags}}
# Requires openocd running
debug: build
arm-none-eabi-gdb -x openocd.gdb -q {{elf_target}}
bin: build
arm-none-eabi-objcopy -O binary {{elf_target}} {{bin_target}}
disassemble: build
arm-none-eabi-objdump --disassemble {{elf_target}} | less -S
doc:
cargo doc --open
fmt:
find src -type f -name '*.rs' | xargs rustfmt
flash: bin erase
st-info --descr
st-flash write {{bin_target}} 0x8000000
erase:
st-flash erase
clean:
cargo clean
picocom:
picocom -b 115200 --imap lfcrlf /dev/ttyACM0