-
Notifications
You must be signed in to change notification settings - Fork 0
/
suit.mk
115 lines (93 loc) · 3.09 KB
/
suit.mk
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#
# Networking
#
# Include packages that pull up and auto-init the link layer.
# NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present
USEMODULE += auto_init_gnrc_netif
# Specify the mandatory networking modules for IPv6 and UDP
USEMODULE += gnrc_ipv6_default
USEMODULE += sock_udp
# Additional networking modules that can be dropped if not needed
USEMODULE += gnrc_icmpv6_echo
# include this for printing IP addresses
# USEMODULE += shell
# USEMODULE += shell_cmds_default
# USEMODULE += shell_cmd_suit
#
# SUIT update specific stuff
#
USEMODULE += suit suit_transport_coap
# enable VFS transport (only works on boards with external storage)
# USEMODULE += suit_transport_vfs
# USEMODULE += vfs_default
# Display a progress bar during firmware download
USEMODULE += progress_bar
# Optional feature to trigger suit update through gpio callback
# FEATURES_OPTIONAL += periph_gpio_irq
# Default COAP manifest resource location when fetched through gpio trigger
CFLAGS += -DSUIT_MANIFEST_RESOURCE=\"$(SUIT_COAP_ROOT)/$(SUIT_NOTIFY_MANIFEST)\"
ifeq ($(BOARD),native)
USE_ETHOS ?= 0
IFACE ?= tapbr0
# Configure two RAM regions with 2K each
CFLAGS += -DCONFIG_SUIT_STORAGE_RAM_REGIONS=2 -DCONFIG_SUIT_STORAGE_RAM_SIZE=2048
endif
# Change this to 0 to not use ethos
USE_ETHOS ?= 1
ifeq (1,$(USE_ETHOS))
USEMODULE += stdio_ethos
USEMODULE += gnrc_uhcpc
# ethos baudrate can be configured from make command
ETHOS_BAUDRATE ?= 115200
CFLAGS += -DETHOS_BAUDRATE=$(ETHOS_BAUDRATE)
# make sure ethos and uhcpd are built
TERMDEPS += host-tools
# For local testing, run
#
# $ cd dist/tools/ethos; sudo ./setup_network.sh riot0 2001:db8::0/64
#
#... in another shell and keep it running.
IFACE ?= riot0
TERMPROG = $(RIOTTOOLS)/ethos/ethos
TERMFLAGS = $(IFACE) $(PORT)
else
USEMODULE += netdev_default
endif
# Ensure both slot bin files are always generated and linked to avoid compiling
# during the test. This ensures that "BUILD_IN_DOCKER=1 make test"
# can rely on them being present without having to trigger re-compilation.
BUILD_FILES += $(SLOT_RIOT_ELFS:%.elf=%.bin)
# DIRS += $(CURDIR)/suit_init
# USEMODULE += suit_init
ifeq ($(BOARD),native)
USEMODULE += suit_storage_ram
USEMODULE += netdev_default
# Use VFS storage for native
USEMODULE += suit_storage_vfs
## Use VFS
USEMODULE += vfs
## Use default storage
USEMODULE += vfs_default
## Auto-format on mount
USEMODULE += vfs_auto_format
else
USEMODULE += suit_storage_flashwrite
endif
# Add custom SUIT targets
include $(CURDIR)/suit.custom.mk
include $(RIOTBASE)/Makefile.include
# allow to use large blocks to utilize large MTUs (802.15.4g, Ethernet, WiFi)
LARGE_BLOCKS ?= 0
ifeq (1, $(LARGE_BLOCKS))
CFLAGS += -DCONFIG_NANOCOAP_BLOCKSIZE_DEFAULT=COAP_BLOCKSIZE_1024
else
# lower pktbuf size to something sufficient for this application
# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig.
ifndef CONFIG_GNRC_PKTBUF_SIZE
CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=2000
endif
endif
.PHONY: host-tools
host-tools:
$(Q)env -u CC -u CFLAGS $(MAKE) -C $(RIOTTOOLS)
include $(RIOTMAKE)/default-radio-settings.inc.mk