-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Make.defs
191 lines (152 loc) · 4.76 KB
/
Make.defs
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
############################################################################
# arch/arm/src/nrf52/Make.defs
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http:https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
include armv7-m/Make.defs
CHIP_CSRCS += nrf52_start.c nrf52_clockconfig.c nrf52_irq.c nrf52_utils.c
CHIP_CSRCS += nrf52_allocateheap.c nrf52_lowputc.c nrf52_gpio.c
CHIP_CSRCS += nrf52_uid.c
ifeq ($(CONFIG_NRF52_SYSTIMER_SYSTICK),y)
CHIP_CSRCS += nrf52_systick.c
endif
ifeq ($(CONFIG_NRF52_SYSTIMER_RTC),y)
CHIP_CSRCS += nrf52_tickless_rtc.c
endif
ifeq ($(CONFIG_ALLOW_BSD_COMPONENTS),y)
CHIP_CSRCS += nrf52_nvmc.c
ifeq ($(CONFIG_NRF52_PROGMEM),y)
CHIP_CSRCS += nrf52_flash.c
endif
endif
ifeq ($(CONFIG_ARCH_CHIP_NRF52832),y)
CHIP_CSRCS += nrf52832_errdata.c
endif
ifeq ($(CONFIG_BUILD_PROTECTED),y)
CHIP_CSRCS += nrf52_userspace.c nrf52_mpuinit.c
endif
ifneq ($(CONFIG_ARCH_IDLE_CUSTOM),y)
CHIP_CSRCS += nrf52_idle.c
endif
ifeq ($(CONFIG_NRF52_GPIOTE),y)
CHIP_CSRCS += nrf52_gpiote.c
endif
ifeq ($(CONFIG_NRF52_UART),y)
CHIP_CSRCS += nrf52_serial.c
endif
ifeq ($(CONFIG_NRF52_WDT),y)
CHIP_CSRCS += nrf52_wdt.c
ifeq ($(CONFIG_WATCHDOG),y)
CHIP_CSRCS += nrf52_wdt_lowerhalf.c
endif
endif
ifeq ($(CONFIG_NRF52_RNG),y)
CHIP_CSRCS += nrf52_rng.c
endif
ifeq ($(CONFIG_NRF52_SPI_MASTER),y)
CHIP_CSRCS += nrf52_spi.c
endif
ifeq ($(CONFIG_NRF52_I2C_MASTER),y)
CHIP_CSRCS += nrf52_i2c.c
endif
ifeq ($(CONFIG_I2C_BITBANG),y)
CHIP_CSRCS += nrf52_i2c_bitbang.c
endif
ifeq ($(CONFIG_NRF52_PPI),y)
CHIP_CSRCS += nrf52_ppi.c
endif
ifeq ($(CONFIG_NRF52_RADIO),y)
CHIP_CSRCS += nrf52_radio.c
ifeq ($(CONFIG_NRF52_RADIO_IEEE802154),y)
CHIP_CSRCS += nrf52_ieee802154_radio.c
CHIP_CSRCS += nrf52_ieee802154_tim.c
CHIP_CSRCS += nrf52_ieee802154.c
ifeq ($(CONFIG_NRF52_RADIO_IEEE802154_SUPERFRAME),y)
CHIP_CSRCS += nrf52_ieee802154_rtc.c
endif
ifeq ($(CONFIG_NRF52_RADIO_IEEE802154_TRACE),y)
CHIP_CSRCS += nrf52_ieee802154_trace.c
endif
endif
endif
ifeq ($(CONFIG_NRF52_TIMER),y)
CHIP_CSRCS += nrf52_tim.c
ifeq ($(CONFIG_TIMER),y)
CHIP_CSRCS += nrf52_tim_lowerhalf.c
endif
endif
ifeq ($(CONFIG_NRF52_RTC),y)
CHIP_CSRCS += nrf52_rtc.c
endif
ifeq ($(CONFIG_NRF52_PWM),y)
CHIP_CSRCS += nrf52_pwm.c
endif
ifeq ($(CONFIG_NRF52_SAADC),y)
CHIP_CSRCS += nrf52_adc.c
endif
ifeq ($(CONFIG_PM),y)
CHIP_CSRCS += nrf52_pminitialize.c
endif
ifeq ($(CONFIG_USBDEV),y)
CHIP_CSRCS += nrf52_usbd.c
endif
ifeq ($(CONFIG_NRF52_QSPI),y)
CHIP_CSRCS += nrf52_qspi.c
endif
ifeq ($(CONFIG_NRF52_SOFTDEVICE_CONTROLLER),y)
NRFXLIB_UNPACK := sdk-nrfxlib
NRFXLIB_VER := 2.3.0
NRFXLIB_REF := v$(NRFXLIB_VER)
NRFXLIB_TGZ := $(NRFXLIB_REF).tar.gz
NRFXLIB_URL := https://github.com/nrfconnect/sdk-nrfxlib/archive
$(NRFXLIB_TGZ):
$(call DOWNLOAD,$(NRFXLIB_URL),$(NRFXLIB_TGZ),chip/$(NRFXLIB_TGZ))
chip/$(NRFXLIB_UNPACK): $(NRFXLIB_TGZ)
$(Q) echo "Unpacking: NRXFLIB"
$(Q) cd chip && tar zxf $(NRFXLIB_TGZ)
$(Q) mv chip/$(NRFXLIB_UNPACK)-$(NRFXLIB_VER)* chip/$(NRFXLIB_UNPACK)
$(Q) touch chip/$(NRFXLIB_UNPACK)
ifeq ($(wildcard chip/$(NRFXLIB_UNPACK)/.git),)
context:: chip/$(NRFXLIB_UNPACK)
distclean::
$(call DELFILE, chip/$(NRFXLIB_TGZ))
$(call DELDIR, chip/$(NRFXLIB_UNPACK))
endif
CHIP_CSRCS += nrf52_sdc.c
NRFXLIB_DIR = $(ARCH_SRCDIR)$(DELIM)chip$(DELIM)sdk-nrfxlib
INCLUDES += \
${INCDIR_PREFIX}$(ARCH_SRCDIR)$(DELIM)chip$(DELIM)sdc \
${INCDIR_PREFIX}$(NRFXLIB_DIR)$(DELIM)mpsl$(DELIM)include \
${INCDIR_PREFIX}$(NRFXLIB_DIR)$(DELIM)softdevice_controller$(DELIM)include
CFLAGS += -DNRF52_SERIES
ifeq ($(CONFIG_ARCH_FPU),y)
LIB_VARIANT=hard-float
else
LIB_VARIANT=soft-float
endif
EXTRA_LIBPATHS += \
-L $(NRFXLIB_DIR)$(DELIM)mpsl$(DELIM)lib$(DELIM)cortex-m4$(DELIM)$(LIB_VARIANT) \
-L $(NRFXLIB_DIR)$(DELIM)softdevice_controller$(DELIM)lib$(DELIM)cortex-m4$(DELIM)$(LIB_VARIANT)
EXTRA_LIBS += -lmpsl
ifeq ($(CONFIG_NRF52_SDC_PERIPHERAL),y)
EXTRA_LIBS += -lsoftdevice_controller_peripheral
else ifeq ($(CONFIG_NRF52_SDC_CENTRAL),y)
EXTRA_LIBS += -lsoftdevice_controller_central
else ifeq ($(CONFIG_NRF52_SDC_MULTIROLE),y)
EXTRA_LIBS += -lsoftdevice_controller_multirole
endif
endif