-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
60 lines (50 loc) · 1.12 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
BOARD ?= ebyte_nrf52805
OPENOCD ?= $(HOME)/repos/openocd
all:
west build -b $(BOARD) -- -DBOARD_ROOT=$(CURDIR)
clean:
rm -rf ./build
flash:
west flash
menuconfig:
west build -t menuconfig
guiconfig:
west build -t guiconfig
init:
@echo "source $(HOME)/zephyrproject/zephyr/zephyr-env.sh"
mcuboot:
west build -s $(HOME)/zephyrproject/bootloader/mcuboot/boot/zephyr/ -d build/mcuboot -b $(BOARD) -- -DBOARD_ROOT=$(CURDIR)
flash_mcuboot: build/mcuboot/zephyr/zephyr.hex
@echo Flashing: $<
$(OPENOCD)/src/openocd \
-s $(OPENOCD)/tcl \
-f interface/stlink.cfg \
-f target/nrf52.cfg \
-c init \
-c "reset init" \
-c halt \
-c "nrf5 mass_erase" \
-c "flash write_image $<" \
-c reset \
-c exit
flashst: build/zephyr/zephyr.hex
@echo Flashing: $<
$(OPENOCD)/src/openocd \
-s $(OPENOCD)/tcl \
-f interface/stlink.cfg \
-f target/nrf52.cfg \
-c init \
-c "reset init" \
-c halt \
-c "nrf5 mass_erase" \
-c "flash write_image $<" \
-c reset \
-c exit
reset:
$(OPENOCD)/src/openocd \
-s $(OPENOCD)/tcl \
-f interface/stlink.cfg \
-f target/nrf52.cfg \
-c init \
-c reset \
-c exit