-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
71 lines (53 loc) · 1.91 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.DEFAULT_GOAL := build
USB ?= /dev/ttyUSB0
T ?= debug
VARIANT ?= sfy-artemis
ifeq "$(T)" "release"
ELF:= target/thumbv7em-none-eabihf/release/$(VARIANT)
override CARGO_FLAGS+=--release
else ifeq "$(T)" "r"
ELF:= target/thumbv7em-none-eabihf/release/$(VARIANT)
override CARGO_FLAGS+=--release
else
ELF:= target/thumbv7em-none-eabihf/debug/$(VARIANT)
endif
docker-build:
docker build -t sfy ..
docker-run:
docker run -it --rm --name sr -v $(shell pwd)/:/ext-gps-mod sfy
bump-jlink:
-python3 ../tools/bump-jlink
build:
cd $(VARIANT) && cargo build $(CARGO_FLAGS)
bin: build
arm-none-eabi-objcopy -S -O binary $(ELF) target/$(VARIANT).bin
# cd sfy-artemis && cargo objcopy $(CARGO_FLAGS) -- -O binary ../target/sfy-buoy.bin
flash: bin
python3 ../tools/svl/svl.py -f target/$(VARIANT).bin $(USB) -v
jlink-flash: bin bump-jlink
sh jlink-flash.sh target/$(VARIANT).bin
deploy: bin
python3 ../tools/svl/svl.py -f target/$(VARIANT).bin $(USB) -v
com:
picocom -e c -b 115200 $(USB)
defmt-serial-mac:
(stty speed 115200 >/dev/null && cat) </dev/cu.usbserial-10 | defmt-print -e $(ELF)
defmt-serial:
socat $(USB),raw,echo=0,b115200 STDOUT | defmt-print -e $(ELF)
gdb-server: bump-jlink
JLinkGDBServer -select USB -device AMA3B1KK-KBR -endian little -if SWD -noir -noLocalhostOnly -nohalt
gdb-flash:
gdb-multiarch --command=flash.gdb $(ELF)
gdb-debug:
gdb-multiarch --command=debug.gdb $(ELF)
defmt-rtt:
# stdbuf -i0 -e0 -o0 JLinkRTTClient < /dev/null | stdbuf -i0 -e0 -o0 tail -f -n +23 | defmt-print -e target/thumbv7em-none-eabihf/debug/sfy-buoy
stdbuf -i0 -e0 -o0 nc localhost 19021 | defmt-print -e $(ELF)
rtt:
# stdbuf -i0 -e0 -o0 JLinkRTTClient < /dev/null | stdbuf -i0 -e0 -o0 tail -f -n +23 | defmt-print -e target/thumbv7em-none-eabihf/debug/sfy-buoy
stdbuf -i0 -e0 -o0 nc localhost 19021
host-test:
cargo test
cargo test --features raw
cargo test --features fir
cargo test --features fir,raw