7
7
name=STM32 boards groups (Board to be selected from Tools submenu 'Board part number')
8
8
version=2.8.0-dev
9
9
10
+
11
+ # Define variables used multiple times in platform file
12
+ # --------------------
13
+ tool_suffix=
14
+ tool_suffix.windows=.exe
15
+
16
+ busybox=
17
+ busybox.windows={runtime.tools.STM32Tools.path}/win/busybox.exe
18
+
19
+ toolchain_dir={runtime.tools.xpack-arm-none-eabi-gcc-13.2.1-1.1.path}
20
+ openocd_dir={runtime.tools.xpack-openocd-0.12.0-2.path}
21
+
22
+ tools_bin_path.windows={runtime.tools.STM32Tools.path}/win
23
+ tools_bin_path.macosx={runtime.tools.STM32Tools.path}/macosx
24
+ tools_bin_path.linux={runtime.tools.STM32Tools.path}/linux
25
+
26
+ core_stm32_dir={build.core.path}/stm32
27
+ core_usb_dir={core_stm32_dir}/usb
28
+ hal_dir={build.system.path}/Drivers/{build.series}_HAL_Driver
29
+ cmsis_dir={runtime.tools.CMSIS-5.9.0.path}/CMSIS
30
+ cmsis_dev_dir={build.system.path}/Drivers/CMSIS/Device/ST/{build.series}
31
+ usbd_core_dir={build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Core
32
+
10
33
# STM compile variables
11
34
# ----------------------
12
- 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/OpenAMP" "-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" {build.virtio_extra_include}
35
+ compiler.stm.extra_include="-I{build.source.path}" "-I{build.core.path}/avr" "-I{core_stm32_dir}" "-I{core_stm32_dir}/LL" "-I{core_usb_dir}" "-I{core_stm32_dir}/OpenAMP" "-I{core_usb_dir}/hid" "-I{core_usb_dir}/cdc" "-I{hal_dir}/Inc" "-I{hal_dir}/Src" "-I{build.system.path}/{build.series}" "-I{usbd_core_dir}/Inc" "-I{usbd_core_dir}/Src" {build.virtio_extra_include}
36
+ compiler.arm.cmsis.c.flags="-I{cmsis_dir}/Core/Include/" "-I{cmsis_dev_dir}/Include/" "-I{cmsis_dev_dir}/Source/Templates/gcc/" "-I{cmsis_dir}/DSP/Include" "-I{cmsis_dir}/DSP/PrivateInclude"
13
37
14
38
compiler.warning_flags=-w
15
39
compiler.warning_flags.none=-w
@@ -23,7 +47,7 @@ compiler.optimization_flags={build.flags.optimize} {build.flags.debug}
23
47
compiler.optimization_flags.release={build.flags.optimize} {build.flags.debug}
24
48
compiler.optimization_flags.debug=-Og -g
25
49
26
- compiler.path={runtime.tools.xpack-arm-none-eabi-gcc-13.2.1-1.1.path }/bin/
50
+ compiler.path={toolchain_dir }/bin/
27
51
28
52
compiler.S.cmd=arm-none-eabi-gcc
29
53
compiler.c.cmd=arm-none-eabi-gcc
@@ -75,8 +99,6 @@ compiler.ar.extra_flags=
75
99
compiler.elf2bin.extra_flags=
76
100
compiler.elf2hex.extra_flags=
77
101
78
- 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"
79
-
80
102
# USB Flags
81
103
# ---------
82
104
build.usb_flags=-DUSBCON {build.usb_speed} -DUSBD_VID={build.vid} -DUSBD_PID={build.pid} -DHAL_PCD_MODULE_ENABLED
@@ -122,10 +144,8 @@ build.opt.path={build.path}/sketch/{build.opt.name}
122
144
extras.path={build.system.path}/extras
123
145
124
146
# Create {build.opt} if not exists in the output sketch dir and force include of SrcWrapper library
125
- recipe.hooks.prebuild.1.pattern="{extras.path}/prebuild.sh" "{build.path}" "{build.source.path}" "{runtime.platform.path}"
126
- 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}"
127
- recipe.hooks.postbuild.1.pattern="{extras.path}/postbuild.sh" "{build.path}" "{build.series}" "{runtime.platform.path}"
128
- 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}"
147
+ recipe.hooks.prebuild.1.pattern="{busybox}" sh "{extras.path}/prebuild.sh" "{build.path}" "{build.source.path}" "{runtime.platform.path}"
148
+ recipe.hooks.postbuild.1.pattern="{busybox}" sh "{extras.path}/postbuild.sh" "{build.path}" "{build.series}" "{runtime.platform.path}"
129
149
130
150
# compile patterns
131
151
# ---------------------
@@ -149,7 +169,7 @@ recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.f
149
169
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"
150
170
151
171
## Create output (.hex file)
152
- 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"
172
+ 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"
153
173
154
174
build.preferred_out_format=bin
155
175
@@ -170,25 +190,20 @@ recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*
170
190
# Upload to board via mass storage
171
191
tools.massStorageCopy.cmd=massStorageCopy.sh
172
192
tools.massStorageCopy.cmd.windows=massStorageCopy.bat
173
- tools.massStorageCopy.path={runtime.tools.STM32Tools.path}/win
174
- tools.massStorageCopy.path.macosx={runtime.tools.STM32Tools.path}/macosx
175
- tools.massStorageCopy.path.linux={runtime.tools.STM32Tools.path}/linux
176
193
tools.massStorageCopy.upload.params.verbose=
177
194
tools.massStorageCopy.upload.params.quiet=
178
- tools.massStorageCopy.upload.pattern="{path }/{cmd}" {upload.verbose} -I "{build.path}/{build.project_name}.bin" -O "{node}"
195
+ tools.massStorageCopy.upload.pattern="{tools_bin_path }/{cmd}" {upload.verbose} -I "{build.path}/{build.project_name}.bin" -O "{node}"
179
196
180
197
# STM32CubeProgrammer upload
181
198
tools.stm32CubeProg.path={runtime.tools.STM32Tools.path}
182
- tools.stm32CubeProg.busybox=
183
- tools.stm32CubeProg.busybox.windows={path}/win/busybox.exe
184
199
tools.stm32CubeProg.cmd=stm32CubeProg.sh
185
200
tools.stm32CubeProg.upload.params.verbose=
186
201
tools.stm32CubeProg.upload.params.quiet=
187
202
tools.stm32CubeProg.upload.pattern="{busybox}" sh "{path}/{cmd}" {upload.protocol} "{build.path}/{build.project_name}.bin" {build.flash_offset} {upload.options}
188
203
189
204
# blackmagic upload for generic STM32
190
205
tools.bmp_upload.cmd=arm-none-eabi-gdb
191
- tools.bmp_upload.path={runtime.tools.xpack-arm-none-eabi-gcc.path }/bin
206
+ tools.bmp_upload.path={toolchain_dir }/bin
192
207
tools.bmp_upload.upload.speed=230400
193
208
tools.bmp_upload.upload.params.verbose=-batch
194
209
tools.bmp_upload.upload.params.quiet=--batch-silent
@@ -198,26 +213,19 @@ tools.bmp_upload.upload.pattern.windows="{path}/{cmd}" -nx -b {upload.speed} {up
198
213
# HID flash 2.2 (HID bootloader v2.2 for STM32F1 and STM32F4 series)
199
214
tools.hid_upload.cmd=hid-flash
200
215
tools.hid_upload.cmd.windows=hid-flash.exe
201
- tools.hid_upload.path={runtime.tools.STM32Tools.path}/win
202
- tools.hid_upload.path.macosx={runtime.tools.STM32Tools.path}/macosx
203
- tools.hid_upload.path.linux={runtime.tools.STM32Tools.path}/linux
204
216
tools.hid_upload.upload.params.verbose=-d
205
217
tools.hid_upload.upload.params.quiet=n
206
- tools.hid_upload.upload.pattern="{path }/{cmd}" "{build.path}/{build.project_name}.bin" {serial.port.file}
218
+ tools.hid_upload.upload.pattern="{tools_bin_path }/{cmd}" "{build.path}/{build.project_name}.bin" {serial.port.file}
207
219
208
220
# Upload using Maple bootloader over DFU
209
221
tools.maple_upload.script=maple_upload.sh
210
- tools.maple_upload.busybox=
211
- tools.maple_upload.busybox.windows={path}/win/busybox.exe
212
222
tools.maple_upload.path={runtime.tools.STM32Tools.path}
213
223
tools.maple_upload.upload.params.verbose=-d
214
224
tools.maple_upload.upload.params.quiet=n
215
225
tools.maple_upload.upload.pattern="{busybox}" sh "{path}/{script}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}.bin"
216
226
217
227
# STM32MP1 self-contained shell script
218
228
tools.remoteproc_gen.path={runtime.tools.STM32Tools.path}
219
- tools.remoteproc_gen.busybox=
220
- tools.remoteproc_gen.busybox.windows={path}/win/busybox.exe
221
229
tools.remoteproc_gen.script=run_arduino_gen.sh
222
230
tools.remoteproc_gen.upload.params.verbose=
223
231
tools.remoteproc_gen.upload.params.quiet=
@@ -229,9 +237,9 @@ tools.remoteproc_gen.upload.pattern="{busybox}" sh "{path}/{script}" generate "{
229
237
# - this is alpha and may be subject to change without notice
230
238
debug.executable={build.path}/{build.project_name}.elf
231
239
debug.toolchain=gcc
232
- debug.toolchain.path={compiler .path}
240
+ debug.toolchain.path={toolchain_dir .path}/bin
233
241
debug.toolchain.prefix=arm-none-eabi-
234
242
debug.server=openocd
235
- debug.server.openocd.path={runtime.tools.xpack-openocd-0.12.0-2.path }/bin/openocd
236
- debug.server.openocd.scripts_dir={runtime.tools.xpack-openocd-0.12.0-2.path }/openocd/scripts
243
+ debug.server.openocd.path={openocd_dir }/bin/openocd
244
+ debug.server.openocd.scripts_dir={openocd_dir }/openocd/scripts
237
245
debug.server.openocd.script={build.path}/openocd.cfg
0 commit comments