-
Notifications
You must be signed in to change notification settings - Fork 3
/
platform.txt
175 lines (138 loc) · 13.1 KB
/
platform.txt
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
# Copyright (c) 2014-2015 Arduino LLC. All right reserved.
# Copyright (c) 2016 Sandeep Mistry All right reserved.
# Copyright (c) 2017 Adafruit Industries. All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
name=OpenThread nRF52 Boards
version=0.0.20200722
# Compile variables
# -----------------
compiler.warning_flags=-w
compiler.warning_flags.none=-w
compiler.warning_flags.default=
compiler.warning_flags.more=-Wall
compiler.warning_flags.all=-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-pointer-arith -Wno-expansion-to-defined
# Allow changing optimization settings via platform.local.txt / boards.local.txt
compiler.optimization_flag=-Ofast
compiler.path={runtime.tools.arm-none-eabi-gcc.path}/bin/
compiler.c.cmd=arm-none-eabi-gcc
compiler.c.flags=-mcpu={build.mcu} -mthumb -c -g {compiler.warning_flags} {build.float_flags} -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -MMD
compiler.c.elf.cmd=arm-none-eabi-gcc
compiler.c.elf.flags={compiler.optimization_flag} -Wl,--gc-sections -save-temps
compiler.S.cmd=arm-none-eabi-gcc
compiler.S.flags=-mcpu={build.mcu} -mthumb -mabi=aapcs {compiler.optimization_flag} -g -c {build.float_flags} -x assembler-with-cpp
compiler.cpp.cmd=arm-none-eabi-g++
compiler.cpp.flags=-mcpu={build.mcu} -mthumb -c -g {compiler.warning_flags} {build.float_flags} -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD
compiler.ar.cmd=arm-none-eabi-ar
compiler.ar.flags=rcs
compiler.objcopy.cmd=arm-none-eabi-objcopy
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
compiler.elf2bin.flags=-O binary
compiler.elf2bin.cmd=arm-none-eabi-objcopy
compiler.elf2hex.flags=-O ihex
compiler.elf2hex.cmd=arm-none-eabi-objcopy
compiler.ldflags=-mcpu={build.mcu} -mthumb {build.float_flags} -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align --specs=nano.specs --specs=nosys.specs
compiler.size.cmd=arm-none-eabi-size
# this can be overriden in boards.txt
build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16 -u _printf_float
build.debug_flags=-DCFG_DEBUG=0
build.logger_flags=-DCFG_LOGGER=1
build.sysview_flags=-DCFG_SYSVIEW=0
build.flags.uart_lock="uart_lock.h"
build.flags.openthread_config="openthread-config-wrap.h"
build.flags.mbedtls_config="nrf-config.h"
build.flags.mbedtls_user_config="nrf52840-mbedtls-config.h"
build.flags.openthread.ftd= -DOPENTHREAD_CONFIG_BORDER_AGENT_ENABLE=1 -DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 -DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 -DOPENTHREAD_CONFIG_COAP_API_ENABLE=1 -DOPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE=1 -DOPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1 -DOPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1 -DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1 -DOPENTHREAD_CONFIG_DIAG_ENABLE=1 -DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1 -DOPENTHREAD_CONFIG_ECDSA_ENABLE=1 -DOPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS=0 -DOPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE=1 -DOPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1 -DOPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1 -DOPENTHREAD_CONFIG_JOINER_ENABLE=1 -DOPENTHREAD_CONFIG_LINK_RAW_ENABLE=1 -DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1 -DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1 -DOPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE=1 -DOPENTHREAD_CONFIG_THREAD_VERSION=2 -DOPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1 -DOPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE=1 -DOPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1 -DOPENTHREAD_ENABLE_NCP_SPINEL_ENCRYPTER=0 -DOPENTHREAD_ENABLE_VENDOR_EXTENSION=0 -DOPENTHREAD_EXAMPLES_SIMULATION=0 -DOPENTHREAD_FTD=1 -DOPENTHREAD_MTD=0 -DOPENTHREAD_PLATFORM_POSIX=0 -DOPENTHREAD_POSIX_CONFIG_DAEMON_ENABLE=0 -DOPENTHREAD_RADIO=0
build.flags.openthread= {build.flags.openthread.ftd} -DMBEDTLS_CONFIG_FILE={build.flags.mbedtls_config} -DMBEDTLS_USER_CONFIG_FILE={build.flags.mbedtls_user_config} -DOPENTHREAD_CONFIG_FILE={build.flags.openthread_config} -DMBEDTLS_USER_CONFIG_FILE={build.flags.mbedtls_user_config} -DCONFIG_GPIO_AS_PINRESET -D__HEAP_SIZE=8192 -D__STACK_SIZE=8192 -DFREERTOS -DNRF52840_XXAA -DBOARD_PCA10056 {build.flags.nordic_includes}
build.flags.nordic_includes= -I{nordic.path}/config/nrf52840/config -I{nordic.path}/softdevice/common -I{nordic.path}/softdevice/s140_nrf52_7.0.1_API/include -I{nordic.path}/softdevice/s140_nrf52_7.0.1_API/include/nrf52 -I{nordic.path}/nrfx -I{nordic.path}/nrfx/legacy -I{nordic.path}/nrfx/drivers/include -I{nordic.path}/nrfx/hal -I{nordic.path}/nrfx/mdk -I{nordic.path}/components/libraries/experimental_section_vars -I{nordic.path}/components/libraries/log -I{nordic.path}/components/libraries/strerror -I{nordic.path}/components/libraries/util -I{nordic.path}/external/nRF-IEEE-802.15.4-radio-driver/src -I{nordic.path}/external/nRF-IEEE-802.15.4-radio-driver/src/fem -I{nordic.path}/external/nRF-IEEE-802.15.4-radio-driver/src/fem/three_pin_gpio -I{nordic.path}/external/nRF-IEEE-802.15.4-radio-driver/src/rsch/raal/softdevice -I{nordic.path}/external/nrf_security/config -I{nordic.path}/external/nrf_security/include -I{nordic.path}/external/nrf_security/mbedtls_plat_config -I{nordic.path}/external/nrf_security/nrf_cc310_plat/include -I{nordic.path}/external/openthread/include
libnrf_cc310.path={nordic.path}/external/nrf_security/lib
libopenthread.path={nordic.path}/external/openthread/lib/nrf52840/gcc
build.libnrf_cc310= {libnrf_cc310.path}/libmbedcrypto_cc310_backend.a {libnrf_cc310.path}/libmbedcrypto_glue.a {libnrf_cc310.path}/libmbedcrypto_glue_cc310.a {libnrf_cc310.path}/libmbedcrypto_glue_vanilla.a {libnrf_cc310.path}/libmbedcrypto_vanilla_backend.a {libnrf_cc310.path}/libmbedtls_base_vanilla.a {libnrf_cc310.path}/libmbedtls_tls_vanilla.a {libnrf_cc310.path}/libmbedtls_x509_vanilla.a {libnrf_cc310.path}/libnrf_cc310_platform_0.9.2.a
build.libopenthread={libopenthread.path}/libopenthread-cli-ftd.a {libopenthread.path}/libopenthread-ftd.a {libopenthread.path}/libopenthread-platform-utils.a {libopenthread.path}/libopenthread-nrf52840-softdevice-sdk.a {libopenthread.path}/libnordicsemi-nrf52840-radio-driver-softdevice.a
# USB flags
build.flags.usb= -DUSBCON -DUSE_TINYUSB -DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'
# These can be overridden in platform.local.txt
compiler.c.extra_flags=
compiler.c.elf.extra_flags=
compiler.cpp.extra_flags=
compiler.S.extra_flags=
compiler.ar.extra_flags=
compiler.libraries.ldflags=
compiler.elf2bin.extra_flags=
compiler.elf2hex.extra_flags=
compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-5.7.0.path}/CMSIS/Core/Include/" "-I{runtime.tools.CMSIS-5.7.0.path}/CMSIS/DSP/Include/"
compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-5.7.0.path}/CMSIS/DSP/Lib/GCC/" -larm_cortexM4lf_math
# common compiler for nrf
rtos.path={build.core.path}/freertos
nordic.path={build.core.path}/nordic
# build.logger_flags and build.sysview_flags are intentionally empty,
# to allow modification via a user's own boards.local.txt or platform.local.txt files.
build.flags.nrf= -DSOFTDEVICE_PRESENT -DARDUINO_NRF52_ADAFRUIT -DNRF52_SERIES -DDX_CC_TEE -DLFS_NAME_MAX=64 {compiler.optimization_flag} {build.debug_flags} {build.logger_flags} {build.sysview_flags} {compiler.arm.cmsis.c.flags} "-I{nordic.path}" "-I{nordic.path}/nrfx" "-I{nordic.path}/nrfx/hal" "-I{nordic.path}/nrfx/mdk" "-I{nordic.path}/nrfx/soc" "-I{nordic.path}/nrfx/drivers/include" "-I{nordic.path}/nrfx/drivers/src" "-I{nordic.path}/softdevice/{build.sd_name}_nrf52_{build.sd_version}_API/include" "-I{nordic.path}/softdevice/{build.sd_name}_nrf52_{build.sd_version}_API/include/nrf52" "-I{rtos.path}/Source/include" "-I{rtos.path}/config" "-I{rtos.path}/portable/GCC/nrf52" "-I{rtos.path}/portable/CMSIS/nrf52" "-I{build.core.path}/sysview/SEGGER" "-I{build.core.path}/sysview/Config" "-I{runtime.platform.path}/libraries/Adafruit_TinyUSB_Arduino/src/arduino"
# Compile patterns
# ----------------
## Compile c files
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} '-DARDUINO_BSP_VERSION="{version}"' {compiler.c.extra_flags} {build.extra_flags} {build.flags.nrf} {build.flags.openthread} {includes} "{source_file}" -o "{object_file}"
## Compile c++ files
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} '-DARDUINO_BSP_VERSION="{version}"' {compiler.cpp.extra_flags} {build.extra_flags} {build.flags.nrf} {build.flags.openthread} {includes} "{source_file}" -o "{object_file}"
## Compile S files
recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {build.flags.nrf} {build.flags.openthread} {includes} "{source_file}" -o "{object_file}"
## Create archives
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} "-L{build.core.path}/linker" "-T{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {compiler.arm.cmsis.ldflags} {object_files} {build.libnrf_cc310} {build.libopenthread} -Wl,--whole-archive "{build.path}/{archive_file}" -Wl,--no-whole-archive -lc -lnosys -lm -lstdc++ -Wl,--end-group
## Create output (bin file)
#recipe.objcopy.bin.pattern="{compiler.path}{compiler.elf2bin.cmd}" {compiler.elf2bin.flags} {compiler.elf2bin.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"
## Create output (hex file)
recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
## Create dfu package zip file
recipe.objcopy.zip.pattern="{tools.nrfutil.cmd}" dfu genpkg --dev-type 0x0052 --sd-req {build.sd_fwid} --application "{build.path}/{build.project_name}.hex" "{build.path}/{build.project_name}.zip"
## Create uf2 file
#recipe.objcopy.uf2.pattern=python "{runtime.platform.path}/tools/uf2conv/uf2conv.py" -f 0xADA52840 -c -o "{build.path}/{build.project_name}.uf2" "{build.path}/{build.project_name}.hex"
## Save bin
recipe.output.tmp_file_bin={build.project_name}.bin
recipe.output.save_file_bin={build.project_name}.save.bin
## Save hex
recipe.output.tmp_file_hex={build.project_name}.hex
recipe.output.save_file_hexu={build.project_name}.save.hex
## Compute size
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
recipe.size.regex=^(?:\.text|\.data|)\s+([0-9]+).*
recipe.size.regex.data=^(?:\.data|\.bss)\s+([0-9]+).*
## Export Compiled Binary
recipe.output.tmp_file={build.project_name}.hex
recipe.output.save_file={build.project_name}.{build.variant}.hex
#***************************************************
# adafruit-nrfutil for uploading
# https://github.com/adafruit/Adafruit_nRF52_nrfutil
# pre-built binaries are provided for macos and windows
#***************************************************
tools.nrfutil.cmd=adafruit-nrfutil
tools.nrfutil.cmd.windows={runtime.platform.path}/tools/adafruit-nrfutil/win32/adafruit-nrfutil.exe
tools.nrfutil.cmd.macosx={runtime.platform.path}/tools/adafruit-nrfutil/macos/adafruit-nrfutil
tools.nrfutil.upload.params.verbose=--verbose
tools.nrfutil.upload.params.quiet=
tools.nrfutil.upload.pattern="{cmd}" {upload.verbose} dfu serial -pkg "{build.path}/{build.project_name}.zip" -p {serial.port} -b 115200 --singlebank
#***************************************************
# Burning bootloader with either jlink or nrfutil
#***************************************************
# Bootloader version
tools.bootburn.bootloader.file={runtime.platform.path}/bootloader/{build.variant}/{build.variant}_bootloader-0.6.1_{build.sd_name}_{build.sd_version}
tools.bootburn.bootloader.params.verbose=
tools.bootburn.bootloader.params.quiet=
tools.bootburn.bootloader.pattern={program.burn_pattern}
# erase flash page while programming
tools.bootburn.erase.params.verbose=
tools.bootburn.erase.params.quiet=
tools.bootburn.erase.pattern=