forked from stm32duino/Arduino_Core_STM32
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplatform.txt
More file actions
295 lines (243 loc) · 16 KB
/
platform.txt
File metadata and controls
295 lines (243 loc) · 16 KB
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# STM32 ARM Core and platform.
# ------------------------------
#
# For more info:
# https://arduino.github.io/arduino-cli/latest/platform-specification/
name=STM32 boards groups (Board to be selected from Tools submenu 'Board part number')
version=2.7.1
# STM compile variables
# ----------------------
compiler.stm.extra_include="-I{build.source.path}" "-I{build.core.path}/avr" "-I{build.core.path}/stm32" "-I{build.core.path}/stm32/LL" "-I{build.core.path}/stm32/usb" "-I{build.core.path}/stm32/usb/hid" "-I{build.core.path}/stm32/usb/cdc" "-I{build.system.path}/Drivers/{build.series}_HAL_Driver/Inc" "-I{build.system.path}/Drivers/{build.series}_HAL_Driver/Src" "-I{build.system.path}/{build.series}" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Core/Src" "-I{runtime.platform.path}/bootloaders" "-I{runtime.platform.path}"
compiler.warning_flags=-w
compiler.warning_flags.none=-w
compiler.warning_flags.default=
compiler.warning_flags.more=-Wall
compiler.warning_flags.all=-Wall -Wextra
# EXPERIMENTAL feature: optimization flags
# - this is alpha and may be subject to change without notice
compiler.optimization_flags={compiler.optimization_flags}
compiler.optimization_flags.release={build.flags.optimize} {build.flags.debug}
compiler.optimization_flags.debug=-Og -g
compiler.path={runtime.tools.xpack-arm-none-eabi-gcc-12.2.1-1.2.path}/bin/
compiler.S.cmd=arm-none-eabi-gcc
compiler.c.cmd=arm-none-eabi-gcc
compiler.cpp.cmd=arm-none-eabi-g++
compiler.ar.cmd=arm-none-eabi-gcc-ar
compiler.c.elf.cmd=arm-none-eabi-gcc
compiler.objcopy.cmd=arm-none-eabi-objcopy
compiler.elf2hex.cmd=arm-none-eabi-objcopy
compiler.libraries.ldflags=
compiler.extra_flags=-mcpu={build.mcu} {build.fpu} {build.float-abi} -DVECT_TAB_OFFSET={build.flash_offset} -DUSE_FULL_LL_DRIVER -mthumb "@{build.opt.path}"
compiler.S.flags={compiler.extra_flags} -c -x assembler-with-cpp {compiler.stm.extra_include}
compiler.c.flags={compiler.extra_flags} -c {compiler.optimization_flags} {compiler.warning_flags} -std={compiler.c.std} -ffunction-sections -fdata-sections --param max-inline-insns-single=500 -MMD {compiler.stm.extra_include}
compiler.cpp.flags={compiler.extra_flags} -c {compiler.optimization_flags} {compiler.warning_flags} -std={compiler.cpp.std} -ffunction-sections -fdata-sections -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -fno-use-cxa-atexit -MMD {compiler.stm.extra_include}
compiler.ar.flags=rcs
compiler.c.elf.flags=-mcpu={build.mcu} {build.fpu} {build.float-abi} -mthumb {compiler.optimization_flags} {build.flags.ldspecs} -Wl,--defsym=LD_FLASH_OFFSET={build.flash_offset} -Wl,--defsym=LD_MAX_SIZE={upload.maximum_size} -Wl,--defsym=LD_MAX_DATA_SIZE={upload.maximum_data_size} -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common
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.elf2hex.flags=-O ihex
compiler.ldflags=-Wl,--no-warn-rwx-segments
compiler.size.cmd=arm-none-eabi-size
compiler.define=-DARDUINO=
# These can be overridden in boards.txt
build.st_extra_flags=
build.extra_flags=
build.bootloader_flags=
build.ldscript=ldscript.ld
build.variant_h=variant_generic.h
# These can be overridden in platform.local.txt
compiler.c.st_extra_flags={build.peripheral_pins}
compiler.c.extra_flags=
compiler.c.std=gnu17
compiler.c.elf.extra_flags=
compiler.cpp.extra_flags=
compiler.cpp.std=gnu++17
compiler.S.st_extra_flags={build.startup_file}
compiler.S.extra_flags=
compiler.ar.extra_flags=
compiler.elf2bin.extra_flags=
compiler.elf2hex.extra_flags=
compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-5.9.0.path}/CMSIS/Core/Include/" "-I{build.system.path}/Drivers/CMSIS/Device/ST/{build.series}/Include/" "-I{build.system.path}/Drivers/CMSIS/Device/ST/{build.series}/Source/Templates/gcc/" "-I{runtime.tools.CMSIS-5.9.0.path}/CMSIS/DSP/Include" "-I{runtime.tools.CMSIS-5.9.0.path}/CMSIS/DSP/PrivateInclude"
# USB Flags
# ---------
build.usb_flags=-DUSBCON {build.usb_speed} -DUSBD_VID={build.vid} -DUSBD_PID={build.pid} -DHAL_PCD_MODULE_ENABLED
# Specify defaults for vid/pid, since an empty value is impossible to
# detect in the preprocessor, but a 0 can be checked for.
# Boards should specify either both, or neither of these.
build.vid=0
build.pid=0
# To customize the USB manufacturer or product string, must add defines
# for them, e.g.:
# some_board.build.extra_flags='-DUSB_MANUFACTURER_STRING="My Company"' '-DUSB_PRODUCT_STRING="My Product"'
# This cannot be done using build variables and specifying the -D
# options here, since then the default would be a defined, but empty macro
# that the preprocessor cannot detect.
# Build information's
build.info.flags=-D{build.series} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DBOARD_NAME="{build.board}" -DVARIANT_H="{build.variant_h}"
# Defaults config
build.xSerial=-DHAL_UART_MODULE_ENABLED
build.enable_usb=
build.usb_speed=
build.peripheral_pins=
build.startup_file=
build.fpu=
build.float-abi=
build.flags.optimize=-Os
build.flags.debug=-DNDEBUG
build.flags.ldspecs=--specs=nano.specs
# Pre and post build hooks
build.opt.name=build.opt
build.opt.path={build.path}/sketch/{build.opt.name}
extras.path={build.system.path}/extras
# Create {build.opt} if not exists in the output sketch dir and force include of SrcWrapper library
recipe.hooks.prebuild.1.pattern="{extras.path}/prebuild.sh" "{build.path}" "{build.source.path}" "{runtime.platform.path}"
recipe.hooks.prebuild.1.pattern.windows="{runtime.tools.STM32Tools.path}/win/busybox.exe" sh "{extras.path}/prebuild.sh" "{build.path}" "{build.source.path}" "{runtime.platform.path}"
recipe.hooks.postbuild.1.pattern="{extras.path}/postbuild.sh" "{build.path}" "{build.series}" "{runtime.platform.path}"
recipe.hooks.postbuild.1.pattern.windows="{runtime.tools.STM32Tools.path}/win/busybox.exe" sh "{extras.path}/postbuild.sh" "{build.path}" "{build.series}" "{runtime.platform.path}"
# compile patterns
# ---------------------
## Compile c files
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} {build.info.flags} {compiler.c.st_extra_flags} {compiler.c.extra_flags} {build.st_extra_flags} {build.extra_flags} {compiler.arm.cmsis.c.flags} {includes} "{source_file}" -o "{object_file}"
## Compile c++ files
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {build.info.flags} {compiler.cpp.extra_flags} {build.st_extra_flags} {build.extra_flags} {compiler.arm.cmsis.c.flags} {includes} "{source_file}" -o "{object_file}"
## Compile S files
recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} {build.info.flags} {compiler.S.st_extra_flags} {compiler.S.extra_flags} {build.st_extra_flags} {build.extra_flags} {compiler.arm.cmsis.c.flags} {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}" {compiler.c.elf.flags} "-Wl,--default-script={build.variant.path}/{build.ldscript}" "-Wl,--script={build.system.path}/ldscript.ld" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -Wl,--start-group {object_files} {compiler.libraries.ldflags} "{archive_file_path}" -lc -Wl,--end-group -lm -lgcc -lstdc++
## Create output (.bin file)
recipe.objcopy.bin.pattern="{compiler.path}{compiler.objcopy.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.objcopy.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
build.preferred_out_format=bin
## Save binary
recipe.output.tmp_file={build.project_name}.{build.preferred_out_format}
recipe.output.save_file={build.project_name}.{build.board}.{build.preferred_out_format}
## Compute size
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
recipe.size.regex=^(?:\.text|\.data|\.rodata)\s+([0-9]+).*
recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).*
recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*
# Uploader tool
# -------------------
# STM32CubeProgrammer upload (using local script with J-Link support)
tools.stm32CubeProg.path={runtime.tools.STM32Tools.path}
tools.stm32CubeProg.busybox=
tools.stm32CubeProg.busybox.windows={path}/win/busybox.exe
tools.stm32CubeProg.cmd=stm32CubeProg.sh
tools.stm32CubeProg.upload.params.verbose=
tools.stm32CubeProg.upload.params.quiet=
tools.stm32CubeProg.upload.pattern="{busybox}" sh "{runtime.platform.path}/system/extras/{cmd}" {upload.protocol} "{build.path}/{build.project_name}.bin" {build.flash_offset} {upload.options}
# blackmagic upload for generic STM32
tools.bmp_upload.cmd=arm-none-eabi-gdb
tools.bmp_upload.path={runtime.tools.xpack-arm-none-eabi-gcc.path}/bin
tools.bmp_upload.upload.speed=230400
tools.bmp_upload.upload.params.verbose=-batch
tools.bmp_upload.upload.params.quiet=--batch-silent
tools.bmp_upload.upload.pattern="{path}/{cmd}" -nx -b {upload.speed} {upload.verbose} -ex "set confirm off" -ex "target extended-remote {serial.port}" -ex "monitor swdp_scan" -ex "attach 1" -ex "load" -ex "compare-sections" -ex "kill" "{build.path}/{build.project_name}.elf"
tools.bmp_upload.upload.pattern.windows="{path}/{cmd}" -nx -b {upload.speed} {upload.verbose} -ex "set confirm off" -ex "target extended-remote \\.\{serial.port}" -ex "monitor swdp_scan" -ex "attach 1" -ex "load" -ex "compare-sections" -ex "kill" "{build.path}/{build.project_name}.elf"
# HID flash 2.2 (HID bootloader v2.2 for STM32F1 and STM32F4 series)
tools.hid_upload.cmd=hid-flash
tools.hid_upload.cmd.windows=hid-flash.exe
tools.hid_upload.path={runtime.tools.STM32Tools.path}/win
tools.hid_upload.path.macosx={runtime.tools.STM32Tools.path}/macosx
tools.hid_upload.path.linux={runtime.tools.STM32Tools.path}/linux
tools.hid_upload.upload.params.verbose=-d
tools.hid_upload.upload.params.quiet=n
tools.hid_upload.upload.pattern="{path}/{cmd}" "{build.path}/{build.project_name}.bin" {serial.port.file}
# Upload using UF2 bootloader (device must be in bootloader mode with drive mounted)
tools.uf2_upload.path={runtime.tools.STM32Tools.path}
tools.uf2_upload.busybox=
tools.uf2_upload.busybox.windows={path}/win/busybox.exe
tools.uf2_upload.cmd=uf2_upload.sh
tools.uf2_upload.upload.params.verbose=-v
tools.uf2_upload.upload.params.quiet=
tools.uf2_upload.upload.pattern="{busybox}" sh "{runtime.platform.path}/system/extras/{cmd}" "{build.path}/{build.project_name}.bin" {build.flash_offset} "{runtime.platform.path}" {build.uf2_family}
# Upload using Maple bootloader over DFU
tools.maple_upload.script=maple_upload.sh
tools.maple_upload.busybox=
tools.maple_upload.busybox.windows={path}/win/busybox.exe
tools.maple_upload.path={runtime.tools.STM32Tools.path}
tools.maple_upload.upload.params.verbose=-d
tools.maple_upload.upload.params.quiet=n
tools.maple_upload.upload.pattern="{busybox}" sh "{path}/{script}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}.bin"
# Clipboard upload (Segger Ozone)
tools.clipboard_upload.path={runtime.tools.STM32Tools.path}
tools.clipboard_upload.busybox=
tools.clipboard_upload.busybox.windows={path}/win/busybox.exe
tools.clipboard_upload.cmd=clipboard.sh
tools.clipboard_upload.upload.params.verbose=
tools.clipboard_upload.upload.params.quiet=
# tools.clipboard_upload.upload.pattern="{busybox}" sh "{path}/{cmd}" "{build.path}/{build.project_name}"
tools.clipboard_upload.upload.pattern="{busybox}" sh "{runtime.platform.path}/system/extras/{cmd}" "{build.path}/{build.project_name}"
# Bootloader burning tools
# ----------------------------------------
# UF2 Bootloader flash via J-Link (using STM32CubeProgrammer with J-Link protocol)
tools.jlink_bootloader.path={runtime.tools.STM32Tools.path}
tools.jlink_bootloader.busybox=
tools.jlink_bootloader.busybox.windows={path}/win/busybox.exe
tools.jlink_bootloader.cmd=stm32CubeProg.sh
tools.jlink_bootloader.erase.params.verbose=
tools.jlink_bootloader.erase.params.quiet=
tools.jlink_bootloader.erase.pattern=
tools.jlink_bootloader.bootloader.params.verbose=
tools.jlink_bootloader.bootloader.params.quiet=
tools.jlink_bootloader.bootloader.pattern="{busybox}" sh "{runtime.platform.path}/system/extras/{cmd}" 3 "{runtime.platform.path}/bootloaders/{build.bootloader_bin}" 0x0
# UF2 Bootloader flash via ST-Link (using STM32CubeProgrammer with SWD protocol)
tools.stlink_bootloader.path={runtime.tools.STM32Tools.path}
tools.stlink_bootloader.busybox=
tools.stlink_bootloader.busybox.windows={path}/win/busybox.exe
tools.stlink_bootloader.cmd=stm32CubeProg.sh
tools.stlink_bootloader.erase.params.verbose=
tools.stlink_bootloader.erase.params.quiet=
tools.stlink_bootloader.erase.pattern=
tools.stlink_bootloader.bootloader.params.verbose=
tools.stlink_bootloader.bootloader.params.quiet=
tools.stlink_bootloader.bootloader.pattern="{busybox}" sh "{runtime.platform.path}/system/extras/{cmd}" 0 "{runtime.platform.path}/bootloaders/{build.bootloader_bin}" 0x0
# UF2 Bootloader flash via J-Link with full chip erase (protocol 13 = 10 + 3)
tools.jlink_bootloader_erase.path={runtime.tools.STM32Tools.path}
tools.jlink_bootloader_erase.busybox=
tools.jlink_bootloader_erase.busybox.windows={path}/win/busybox.exe
tools.jlink_bootloader_erase.cmd=stm32CubeProg.sh
tools.jlink_bootloader_erase.erase.params.verbose=
tools.jlink_bootloader_erase.erase.params.quiet=
tools.jlink_bootloader_erase.erase.pattern=
tools.jlink_bootloader_erase.bootloader.params.verbose=
tools.jlink_bootloader_erase.bootloader.params.quiet=
tools.jlink_bootloader_erase.bootloader.pattern="{busybox}" sh "{runtime.platform.path}/system/extras/{cmd}" 13 "{runtime.platform.path}/bootloaders/{build.bootloader_bin}" 0x0
# UF2 Bootloader flash via ST-Link with full chip erase (protocol 10 = 10 + 0)
tools.stlink_bootloader_erase.path={runtime.tools.STM32Tools.path}
tools.stlink_bootloader_erase.busybox=
tools.stlink_bootloader_erase.busybox.windows={path}/win/busybox.exe
tools.stlink_bootloader_erase.cmd=stm32CubeProg.sh
tools.stlink_bootloader_erase.erase.params.verbose=
tools.stlink_bootloader_erase.erase.params.quiet=
tools.stlink_bootloader_erase.erase.pattern=
tools.stlink_bootloader_erase.bootloader.params.verbose=
tools.stlink_bootloader_erase.bootloader.params.quiet=
tools.stlink_bootloader_erase.bootloader.pattern="{busybox}" sh "{runtime.platform.path}/system/extras/{cmd}" 10 "{runtime.platform.path}/bootloaders/{build.bootloader_bin}" 0x0
# Burn bootloader using DFU (USB)
# Requires board to be in DFU mode first (hold BOOT button + reset)
tools.dfu_bootloader.path={runtime.tools.STM32Tools.path}
tools.dfu_bootloader.busybox=
tools.dfu_bootloader.busybox.windows={path}/win/busybox.exe
tools.dfu_bootloader.cmd=dfu-util.sh
tools.dfu_bootloader.erase.params.verbose=
tools.dfu_bootloader.erase.params.quiet=
tools.dfu_bootloader.erase.pattern=
tools.dfu_bootloader.bootloader.params.verbose=-v
tools.dfu_bootloader.bootloader.params.quiet=
tools.dfu_bootloader.bootloader.pattern="{busybox}" sh "{path}/{cmd}" -a 0 -s 0x08000000:leave -D "{runtime.platform.path}/bootloaders/{build.bootloader_bin}"
# Debugger configuration (general options)
# ----------------------------------------
# EXPERIMENTAL feature:
# - this is alpha and may be subject to change without notice
debug.executable={build.path}/{build.project_name}.elf
debug.toolchain=gcc
debug.toolchain.path={compiler.path}
debug.toolchain.prefix=arm-none-eabi-
debug.server=openocd
debug.server.openocd.path={runtime.tools.xpack-openocd-0.12.0-1.path}/bin/openocd
debug.server.openocd.scripts_dir={runtime.tools.xpack-openocd-0.12.0-1.path}/openocd/scripts
debug.server.openocd.script={build.path}/openocd.cfg