-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile.config.template
106 lines (95 loc) · 4.63 KB
/
Makefile.config.template
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
# Your SDK Directories
HOME = ~
# SDK 9.0.0
# Softdevice 8.0.0
#
SDK_PATH = $(HOME)Developer/prjs/embeded/nrf/nRF51_SDK_9.0.0_2e23562/components/
SOFTDEVICE_HEX_PATH = $(HOME)Developer/prjs/embeded/nrf/nRF51_SDK_9.0.0_2e23562/components/softdevice/s110/hex/s110_softdevice.hex
BUILD_SCRIPTS_PATH = $(HOME)Developer/prjs/embeded/prjs/nrf51822/build_scripts/
TEMPLATE_PATH = $(HOME)Developer/prjs/embeded/nrf/nRF51_SDK_9.0.0_2e23562/components/softdevice/s110/toolchain/armgcc
TEMPLATE_PATH += $(HOME)Developer/prjs/embeded/nrf/nRF51_SDK_9.0.0_2e23562/components/toolchain/gcc/
# override LINKER_SCRIPT of Makefile.common
ifeq ($(USE_SOFTDEVICE), S110)
LINKER_SCRIPT = armgcc_s110_nrf51822_$(DEVICE_VARIANT).ld
OUTPUT_FILENAME := $(OUTPUT_FILENAME)_s110_$(DEVICE_VARIANT)
STARTADDRESS = 0x18000
else
ifeq ($(USE_SOFTDEVICE), S120)
LINKER_SCRIPT = armgcc_s120_nrf51822_$(DEVICE_VARIANT).ld
OUTPUT_FILENAME := $(OUTPUT_FILENAME)_s120_$(DEVICE_VARIANT)
STARTADDRESS = 0x1D000
else
ifeq ($(USE_SOFTDEVICE), S130)
LINKER_SCRIPT = armgcc_s130_nrf51822_$(DEVICE_VARIANT).ld
OUTPUT_FILENAME := $(OUTPUT_FILENAME)_s130_$(DEVICE_VARIANT)
STARTADDRESS = 0x20000
endif
endif
endif
# ALL_DIRS =
# C_SOURCE_PATHS += $(sort $(dir $(wildcard $(SDK_PATH)**/**/)))
# INCLUDEPATHS += $(patsubst %, -I%, $(sort $(dir $(wildcard $(SDK_PATH)**/*.h))))
#
C_SOURCE_PATHS += $(sort $(dir $(shell find $(SDK_PATH) -iname "*.c" -print)))
# search all include path excluding s110 , s120 , s130 , etc
INCLUDEPATHS += $(patsubst %, -I%, $(sort $(dir $(shell find -E $(SDK_PATH) -iname "*.h" -not -iregex ".*/s[0123]{3}/.*" -not -ipath "*/nrf_soc_nosd/*" -print))))
INCLUDEPATHS += $(patsubst %, -I%, $(sort $(dir $(shell find $(SDK_PATH) -iname "*.h" -path "*/s110/*" -print))))
INCLUDEPATHS += -I$(SDK_PATH)../examples/bsp/
## for prior to Softdevice 7.0.0
# INCLUDEPATHS += -I./src
# INCLUDEPATHS += -I"$(SDK_PATH)/Include"
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/gcc"
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/console"
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/nrf_assert"
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/sdk"
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/app_common"
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/sd_common"
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/ble"
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/ble/ble_services"
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/ble/device_manager"
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/ble/device_manager/experimental"
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/ext_sensors"
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/serialization"
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/serialization/common"
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/serialization/common/transport"
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/serialization/common/struct_ser"
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/serialization/connectivity"
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/serialization/connectivity/codecs"
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/serialization/application/transport"
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/serialization/application/codecs/common"
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/serialization/application/codecs/s110/serializers"
#
# ifeq ($(USE_SOFTDEVICE), S110-v6)
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/s110"
# else
# ifeq ($(USE_SOFTDEVICE), S110)
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/s110"
# else
# ifeq ($(USE_SOFTDEVICE), S120)
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/s120"
# else
# INCLUDEPATHS += -I"$(SDK_PATH)/Include/sdk_soc"
# endif
# endif
# endif
## old softdevice
# SDK_PATH = $(HOME)Developer/prjs/embeded/nrf/nrf51_sdk_v6_0_0_43681/nrf51822/
# SOFTDEVICE_HEX_PATH = $(HOME)Developer/prjs/embeded/nrf/s110_nrf51822_7.0.0/s110_nrf51822_7.0.0_softdevice.hex
# BUILD_SCRIPTS_PATH = $(HOME)Developer/prjs/embeded/prjs/nrf51822/build_scripts/
# TEMPLATE_PATH = $(BUILD_SCRIPTS_PATH)
#
GNU_INSTALL_ROOT := $(HOME)Developer/prjs/embeded/gcc-arm-none-eabi-4_9-2015q3
# GNU_INSTALL_ROOT := $(HOME)Developer/prjs/embeded/gcc-arm-none-eabi-4_8-2014q2
# GNU_INSTALL_ROOT := /opt/gcc-arm-none-eabi-4_8-2014q2
GNU_VERSION := 4.9.3
GNU_PREFIX := arm-none-eabi
# Flasher selection
FLASHER := JLink
#FLASHER := OpenOCD
# Toolchain commands
JLINK := JLinkExe -Device nrf51822 -speed 100 -if swd
#You need to change openOCD clause depending your dongle. I have stlink-v2 and it's working. Jlink will work if you fetch latest trunk from git.
OPENOCD := /usr/local/bin/openocd -f interface/stlink-v2.cfg -c"transport select hla_swd" -f target/nrf51.cfg
#OPENOCD := /usr/local/bin/openocd -f interface/jlink.cfg -c"transport select swd ; adapter_khz 1000 ; adapter_nsrst_delay 10" -f /home/death/de/nrf51.cfg
serial:
screen /dev/cu.usbserial 38400