forked from sparkfun/Arduino_Apollo3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplatform.txt
174 lines (131 loc) · 8.64 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
# The MIT License (MIT)
# Copyright (c) 2019 SparkFun Electronics
# Contributors:
# Owen Lyke
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
name=SparkFun Apollo3
version=0.1.0
## Extra Flags (can be overridden in platform.local.txt)
compiler.extra_flags.cpp=
compiler.extra_flags.c=
compiler.extra_flags.S=
compiler.extra_flags.ld=
compiler.extra_flags.ar=
compiler.extra_flags.axf2bin=
## Paths
ap3core.path={runtime.platform.path}/cores/{build.core}
ap3variant.path={build.variant.path}
ap3core.ambiq_sdk.path={ap3core.path}/am_sdk_ap3
## Core Includes
includes.extra=
includes.ambiq_sdk="-I{ap3core.ambiq_sdk.path}/mcu/apollo3" "-I{ap3core.ambiq_sdk.path}/mcu/apollo3/hal" "-I{ap3core.ambiq_sdk.path}/mcu/apollo3/regs" "-I{ap3core.ambiq_sdk.path}/utils"
includes.cmsis="-I{ap3core.ambiq_sdk.path}/CMSIS/AmbiqMicro/Include" "-I{ap3core.ambiq_sdk.path}/CMSIS/ARM/Include"
includes.core="-I{ap3core.path}/ard_sup" "-I{ap3core.path}/ard_sup/ard_supers" {includes}
includes.variant="{build.includes}"
## Precompiled Libraries
libs.extra=
libs.ambiq_sdk=
libs.cmsis=
libs.core=
libs.variant={build.libs}
## Defines
defines.extra=
defines.hw=-DF_CPU={build.f_cpu}
defines.arduino=-DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch}
defines.variant={build.defs}
## Compiler and Toolchain
compiler.path={runtime.tools.arm-none-eabi-gcc-8-2018-q4-major.path}/bin
compiler.cmd.cpp=arm-none-eabi-g++
compiler.cmd.c=arm-none-eabi-gcc
compiler.cmd.S=arm-none-eabi-gcc
compiler.cmd.ar=arm-none-eabi-ar
compiler.cmd.axf=arm-none-eabi-gcc
compiler.cmd.axf2bin=arm-none-eabi-objcopy
compiler.cmd.size=arm-none-eabi-size
compiler.warning_flags=-w
compiler.warning_flags.none=-w
compiler.warning_flags.default=
compiler.warning_flags.more=-Wall
compiler.warning_flags.all=-Wall -Wextra
compiler.flags.common_cpp_c_S={build.extra_flags} -c -g -MMD
compiler.flags.common_cpp_c=-mcpu={build.mcu} -mthumb -mfloat-abi=hard -fdata-sections -Os
compiler.flags.cpp={compiler.flags.common_cpp_c_S} {compiler.flags.common_cpp_c} {compiler.extra_flags.cpp} -ffunction-sections {compiler.warning_flags} -std=gnu++11 -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions
compiler.flags.c={compiler.flags.common_cpp_c_S} {compiler.flags.common_cpp_c} {compiler.extra_flags.c} --function-sections -mfpu=fpv4-sp-d16 -std=gnu11 -Wall
compiler.flags.S={compiler.flags.common_cpp_c_S} {compiler.extra_flags.S} -x assembler-with-cpp
compiler.flags.ld={compiler.extra_flags.ld} "-L{ap3core.ambiq_sdk.path}/CMSIS/ARM/Lib/ARM" -larm_cortexM4l_math -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -static -Wl,--gc-sections,--entry,Reset_Handler -Wl,--start-group -lm -lc -lgcc -Wl,--end-group -fno-exceptions -nostdlib --specs=nano.specs -t -lstdc++ -lc -lnosys -lm
compiler.flags.ar=rcs {compiler.extra_flags.ar}
compiler.flags.axf2bin={compiler.extra_flags.axf2bin} -O binary
includes.all={includes.variant} {includes.core} {includes.ambiq_sdk} {includes.cmsis} {includes.extra}
defines.all={defines.variant} {defines.hw} {defines.arduino} {defines.extra}
libs.all={archive_file_path} {libs.extra} {libs.ambiq_sdk} {libs.cmsis} {libs.core} {libs.variant} {libs.extra}
## Arduino Patterns
## compile c files
recipe.c.o.pattern="{compiler.path}/{compiler.cmd.c}" {compiler.flags.c} {defines.all} {includes.all} "{source_file}" -o "{object_file}"
## compile c++ files
recipe.cpp.o.pattern="{compiler.path}/{compiler.cmd.cpp}" {compiler.flags.cpp} {defines.all} {includes.all} "{source_file}" -o "{object_file}"
## compile S files
recipe.S.o.pattern="{compiler.path}/{compiler.cmd.S}" {compiler.flags.S} {defines.all} {includes.all} "{source_file}" -o "{object_file}"
## Create archives
## archive_file_path is needed for backwards compatibility with IDE 1.6.5 or older, IDE 1.6.6 or newer overrides this value
archive_file_path={build.path}/{archive_file}
recipe.ar.pattern="{compiler.path}/{compiler.cmd.ar}" {compiler.flags.ar} "{archive_file_path}" "{object_file}"
## Combine gc-sections, archives, and objects (.axf)
recipe.c.combine.pattern="{compiler.path}/{compiler.cmd.axf}" "-T{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" -o "{build.path}/{build.project_name}.axf" {object_files} {libs.all} {compiler.flags.ld}
## Create output (.bin)
recipe.objcopy.bin.pattern="{compiler.path}/{compiler.cmd.axf2bin}" {compiler.flags.axf2bin} "{build.path}/{build.project_name}.axf" "{build.path}/{build.project_name}.bin"
## Compute size
recipe.size.pattern="{compiler.path}/{compiler.cmd.size}" -A "{build.path}/{build.project_name}.axf"
recipe.size.regex=\.text\s+([0-9]+).*
## Preprocessor
preproc.macros.flags=-w -x c++ -E -CC
recipe.preproc.macros="{compiler.path}/{compiler.cmd.cpp}" {compiler.flags.cpp} {preproc.macros.flags} -mcpu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.extra_flags.cpp} {build.extra_flags} {includes.all} "{source_file}" -o "{preprocessed_file_path}"
## Exporting Compiled Files
recipe.output.tmp_file={build.project_name}.{build.preferred_export_format}
recipe.output.save_file={build.project_name}.{build.preferred_export_format}
##### The following tool settings are for the Ambiq SBL
# Host-specific definitions for upload tool (using Ambiq's Secure Bootloader SBL)
# Linux
tools.ambiq_bin2board.pgm={runtime.platform.path}/tools/ambiq/linux/ambiq_bin_to_board/ambiq_bin_to_board
tools.ambiq_bin2board.args=--bin "{build.path}/{build.project_name}.bin" --load-address-blob 0x20000 --magic-num 0xCB -o {build.path}/{build.project_name} --version 0x0 --load-address-wired 0xC000 -i 6 --options 0x1 -b 115200 -port "{serial.port}" -r 2 {upload.verbose}
# MacOSX
tools.ambiq_bin2board.pgm.macosx={runtime.platform.path}/tools/ambiq/macosx/ambiq_bin_to_board/ambiq_bin_to_board
tools.ambiq_bin2board.args.macosx=--bin "{build.path}/{build.project_name}.bin" --load-address-blob 0x20000 --magic-num 0xCB -o {build.path}/{build.project_name} --version 0x0 --load-address-wired 0xC000 -i 6 --options 0x1 -b 115200 -port "{serial.port}" -r 2 {upload.verbose}
# Windows
tools.ambiq_bin2board.pgm.windows="{runtime.platform.path}/tools/ambiq/windows/ambiq_bin_to_board/ambiq_bin_to_board.exe"
tools.ambiq_bin2board.args.windows=--bin "{build.path}/{build.project_name}.bin" --load-address-blob 0x20000 --magic-num 0xCB -o {build.path}/{build.project_name} --version 0x0 --load-address-wired 0xC000 -i 6 --options 0x1 -b 115200 -port "{serial.port}" -r 2 {upload.verbose}
# Additional Loader Parameters
tools.ambiq_bin2board.upload.protocol=ap3
tools.ambiq_bin2board.upload.params.verbose=-v
tools.ambiq_bin2board.upload.params.quiet=
# Upload tool pattern
tools.ambiq_bin2board.upload.pattern={pgm} {args}
##### The following tool settings are for the SparkFun variable bootloader (Artemis SVL) (Saturn Five Loader)
# Linux
tools.artemis_svl.pgm={runtime.platform.path}/tools/ambiq/linux/artemis_svl/artemis_svl
tools.artemis_svl.args="{serial.port}" -f "{build.path}/{build.project_name}.bin" -b {upload.baud} {upload.verbose}
# MacOSX
tools.artemis_svl.pgm.macosx={runtime.platform.path}/tools/ambiq/macosx/artemis_svl/artemis_svl
tools.artemis_svl.args.macosx="{serial.port}" -f "{build.path}/{build.project_name}.bin" -b {upload.baud} {upload.verbose}
# Windows
tools.artemis_svl.pgm.windows="{runtime.platform.path}/tools/artemis/windows/artemis_svl.exe"
tools.artemis_svl.args.windows="{serial.port}" -f "{build.path}/{build.project_name}.bin" -b {upload.baud} {upload.verbose}
# Additional Loader Parameters
tools.artemis_svl.upload.protocol=ap3
tools.artemis_svl.upload.params.verbose=-v
tools.artemis_svl.upload.params.quiet=
# Upload tool pattern
tools.artemis_svl.upload.pattern={pgm} {args}