forked from viamrobotics/micro-rdk-robot-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (28 loc) · 1.44 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
.PHONY: build
SHELL := /bin/bash
ESPFLASHVERSION = $(shell expr `cargo espflash -V | grep ^cargo-espflash | sed 's/^.* //g' | cut -f1 -d. ` \< 2)
cargo-ver:
ifeq "$(ESPFLASHVERSION)" "1"
$(error Update espfash to version >2.0. Update with cargo install [email protected])
endif
build:
cargo build
{% if qemu %}build-qemu:
cargo build --example esp32 --features qemu && cargo espflash save-image --features qemu --merge --chip esp32 target/xtensa-esp32-espidf/debug/debug.bin -T partitions.csv -s 4M --example esp32
sim-local: cargo-ver build-qemu
ifndef QEMU_ESP32_XTENSA
$(error QEMU_ESP32_XTENSA is not set)
endif
pkill qemu || true
$(QEMU_ESP32_XTENSA)/qemu-system-xtensa -nographic -machine esp32 -gdb tcp::3334 -nic user,model=open_eth,hostfwd=tcp::7888-:80 -drive file=target/xtensa-esp32-espidf/debug/debug.bin,if=mtd,format=raw
# debug-local is identical to sim-local, except the `-S` at the end means "wait until a debugger is
# attached before starting."
debug-local: cargo-ver build-qemu
ifndef QEMU_ESP32_XTENSA
$(error QEMU_ESP32_XTENSA is not set)
endif
pkill qemu || true
$(QEMU_ESP32_XTENSA)/qemu-system-xtensa -nographic -machine esp32 -gdb tcp::3334 -nic user,model=open_eth,hostfwd=tcp::7888-:80 -drive file=target/xtensa-esp32-espidf/debug/debug.bin,if=mtd,format=raw -S
{% endif %}
upload: cargo-ver
cargo espflash flash --monitor --partition-table partitions.csv --baud 460800 -f 80M --use-stub $(ESPFLASH_FLASH_ARGS)