generated from andreyk0/stm32-rust-rtic-blink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (35 loc) · 781 Bytes
/
Makefile
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
40
41
42
43
44
45
46
NAME?=blink
# debug | release
BUILD?=debug
ELF_TARGET:=target/thumbv7m-none-eabi/$(BUILD)/$(NAME)
BIN_TARGET:=target/$(NAME).bin
build: fmt
cargo build $(if $(findstring release,$(BUILD)),--release,)
# 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
.PHONY: \
bin \
build \
clean \
disassemble \
erase \
flash \
picocom \