-
Notifications
You must be signed in to change notification settings - Fork 14
/
platform.txt
174 lines (142 loc) · 9.08 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.
# Copyright (c) 2020 Shenzhen RAKwireless Technology Co., Ltd. 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=RAKwireless RUI STM32 Modules
# 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
# Allow changing optimization settings via platform.local.txt / boards.local.txt
compiler.optimization_flag=-Os
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 --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=-c -g -x assembler-with-cpp {compiler.warning_flags}
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 --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 -S
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 --specs=nano.specs --specs=nosys.specs {build.flags.lib_path}
compiler.size.cmd=arm-none-eabi-size
# this can be overriden in boards.txt
build.float_flags=-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.support_at_flag=-DSUPPORT_AT
build.variant_h=variant.h
build.supportlora=
build.supportlora_p2p=
build.regionAS923=
build.regionAU915=
build.regionCN470=
build.regionCN779=
build.regionEU433=
build.regionEU868=
build.regionKR920=
build.regionIN865=
build.regionUS915=
build.regionRU864=
build.regionLA915=
# common compiler for nrf
#rtos.path={build.core.path}/freertos
#nordic.path={runtime.platform.path}/cores/nRF5/external/nRF5_SDK/nRF5_SDK_17.0.2_d674dde
lora.path={runtime.platform.path}/cores/{build.core}/external/lora
# build.logger_flags and build.sysview_flags and intentionally empty,
# to allow modification via a user's own boards.local.txt or platform.local.txt files.
build.flags.default= {compiler.optimization_flag} {build.flags.feature} {build.supportlora} {build.supportlora_p2p} {build.regionAS923} {build.regionAU915} {build.regionCN470} {build.regionCN779} {build.regionEU433} {build.regionEU868} {build.regionKR920} {build.regionIN865} {build.regionUS915} {build.regionRU864} {build.regionLA915} {build.debug_flags} {build.logger_flags} {build.sysview_flags} {build.flags.inc_path} {build.support_at_flag}
build.info.flags=-DVARIANT_H="{build.variant_h}"
build.info.flags=-D{build.series}
# usb flags
build.flags.usb= -DUSBCON -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= -DDEBUG
compiler.S.extra_flags=
compiler.ar.extra_flags=
compiler.libraries.ldflags=
compiler.elf2bin.extra_flags=
compiler.elf2hex.extra_flags=
# 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.default} {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.default} {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.default} {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}/component/core/soc/stm32wle5xx" "-T{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} {compiler.libraries.ldflags} -Wl,--start-group -lc -lm -lnosys -lstdc++ "{build.path}/{archive_file}" {build.flags.lib} -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="{runtime.tools.pc-nrfutil.path}/nrfutil" pkg generate --hw-version 52 --application-version 1 --application "{build.path}/{build.project_name}.hex" --sd-req {build.sd_fwid} --key-file {runtime.platform.path}/security/private.key "{build.path}/{build.project_name}.zip"
## 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
tools.uploader_ymodem.cmd="{runtime.tools.uploader_ymodem.path}/uploader_ymodem.py"
tools.uploader_ymodem.cmd.windows="{runtime.tools.uploader_ymodem.path}/uploader_ymodem.exe"
tools.uploader_ymodem.cmd.macosx=python3 "{runtime.tools.uploader_ymodem.path}/uploader_ymodem.py"
tools.uploader_ymodem.upload.params.verbose=--verbose
tools.uploader_ymodem.upload.params.quiet=
tools.uploader_ymodem.upload.pattern={cmd} -f "{build.path}/{build.project_name}.bin" -p {serial.port}
#***************************************************
# prebuild hooks for buildtime
#***************************************************
recipe.hooks.sketch.prebuild.1.pattern=python3 "{runtime.tools.buildtime.path}/buildtime.py" "{runtime.platform.path}/variants/{build.variant}/version.c"
recipe.hooks.sketch.prebuild.1.pattern.windows="{runtime.tools.buildtime.path}/buildtime.exe" "{runtime.platform.path}/variants/{build.variant}/version.c"
#***************************************************
# Burning bootloader with either jlink or nrfutil
#***************************************************
# Bootloader version
tools.bootburn.bootloader.file={runtime.platform.path}/prebuilt/bootloader.hex
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=
version=4.2.1