-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
114 lines (73 loc) · 2.49 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
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
PROJECT_NAME=test
C_SOURCE_FILES := $(wildcard src/*.c)
SRCS_AS :=
INC_PATHS := -I src
#DEVICE = NRF51
DEVICE = NRF52
MISC=nrf5x-dk-gcc/misc
#BOARD=BOARD_PCA10028
BOARD=BOARD_PCA10036
#CHIP=nRF51822-QFAA
#CHIP=nRF51822-CEAA
#CHIP=nRF51822-QFAB
#CHIP=nRF51822-CDAB
#CHIP=nRF51822-QFAC
#CHIP=nRF51822-CFAC
#CHIP=nRF51422-QFAA
#CHIP=nRF51422-CEAA
#CHIP=nRF51422-QFAB
#CHIP=nRF51422-CDAB
## nRF51-DK : CHIP=nRF51422-QFAC
#CHIP=nRF51422-QFAC
CHIP=nRF52832-QFAA
# From nRF51_Series_Compatibility_Matrix_v1.2.pdf :
# The nRF51-DK and nRF51-Dongle is using the nRF51422-QFAC variant of the chip
SDK_TYPE=0.x.x
SDK_VERSION=nRF52_SDK_0.9.2_dbc28c9
SDK_URL=http://developer.nordicsemi.com/nRF52_SDK/nRF52_SDK_v0.x.x/
#SDK_TYPE=7.x.x
#SDK_VERSION=nRF51_SDK_7.2.0_cf547b5
#SDK_URL=http://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v7.x.x
SDK_INSTALL_DIR=../../nordic
USE_SOFT_DEVICE=no
CFLAGS = -DCONFIG_GPIO_AS_PINRESET
CFLAGS += -DBOARD_PCA10036
CFLAGS += -DNRF52
CFLAGS += -DBSP_DEFINES_ONLY
# We want to re-route printf strings to the UART, not the debugger
CFLAGS += -DPRINTF_USES_UART
# list SDK modules used (see misc/SDK_Makefile.mk)
# Startup code
SDK_TOOLCHAIN_GCC=yes
# Support libraries
SDK_DRIVERS_NRF_HAL=yes
SDK_LIBRARIES_FIFO=yes
SDK_DRIVERS_NRF_CONFIG=yes
SDK_DRIVERS_NRF_COMMON=yes
# Bad SDK organisation - FreeRTOS is included by default...
#SDK_LIBRARIES_TIMER=yes
C_SOURCE_FILES += $(SDK_INSTALL_DIR)/$(SDK_VERSION)/components/libraries/timer/app_timer.c
INC_PATHS += -I $(SDK_INSTALL_DIR)/$(SDK_VERSION)/components/libraries/timer
# Same for UART libraries - it includes two versions of the same API
# we have to pick the right file
#SDK_LIBRARIES_UART=yes
#SDK_DRIVERS_NRF_UART=yes
C_SOURCE_FILES += $(SDK_INSTALL_DIR)/$(SDK_VERSION)/components/libraries/uart/app_uart_fifo.c
INC_PATHS += -I $(SDK_INSTALL_DIR)/$(SDK_VERSION)/components/libraries/uart
C_SOURCE_FILES += $(SDK_INSTALL_DIR)/$(SDK_VERSION)/components/drivers_nrf/uart/nrf_drv_uart.c
INC_PATHS += -I $(SDK_INSTALL_DIR)/$(SDK_VERSION)/components/drivers_nrf/uart
# SDK for nRF52 has a different structure
# here are some lib/drivers that are almost always required
ifeq ($(DEVICE),NRF52)
SDK_DRIVERS_NRF_DELAY=yes
SDK_LIBRARIES_UTIL=yes
# Fixme below - only if no Soft Device used
SDK_DRIVERS_NRF_NRF_SOC_NOSD=yes
endif
# Don't touch lines below
include $(MISC)/nRF51_Devices.mk
include $(MISC)/nRF52_Devices.mk
-include $(MISC)/SDK_Makefile.mk
include $(MISC)/Main.mk
include $(MISC)/nrftools_jlink.mk
include $(MISC)/check.mk