77name=STM32 boards groups (Board to be selected from Tools submenu 'Board part number')
88version=2.8.0-dev
99
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+
1033# STM compile variables
1134# ----------------------
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"
1337
1438compiler.warning_flags=-w
1539compiler.warning_flags.none=-w
@@ -23,7 +47,7 @@ compiler.optimization_flags={build.flags.optimize} {build.flags.debug}
2347compiler.optimization_flags.release={build.flags.optimize} {build.flags.debug}
2448compiler.optimization_flags.debug=-Og -g
2549
26- compiler.path={runtime.tools.xpack-arm-none-eabi-gcc-13.2.1-1.1.path }/bin/
50+ compiler.path={toolchain_dir }/bin/
2751
2852compiler.S.cmd=arm-none-eabi-gcc
2953compiler.c.cmd=arm-none-eabi-gcc
@@ -75,8 +99,6 @@ compiler.ar.extra_flags=
7599compiler.elf2bin.extra_flags=
76100compiler.elf2hex.extra_flags=
77101
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-
80102# USB Flags
81103# ---------
82104build.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}
122144extras.path={build.system.path}/extras
123145
124146# 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}"
129149
130150# compile patterns
131151# ---------------------
@@ -149,7 +169,7 @@ recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.f
149169recipe.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"
150170
151171## 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"
153173
154174build.preferred_out_format=bin
155175
@@ -170,25 +190,20 @@ recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*
170190# Upload to board via mass storage
171191tools.massStorageCopy.cmd=massStorageCopy.sh
172192tools.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
176193tools.massStorageCopy.upload.params.verbose=
177194tools.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}"
179196
180197# STM32CubeProgrammer upload
181198tools.stm32CubeProg.path={runtime.tools.STM32Tools.path}
182- tools.stm32CubeProg.busybox=
183- tools.stm32CubeProg.busybox.windows={path}/win/busybox.exe
184199tools.stm32CubeProg.cmd=stm32CubeProg.sh
185200tools.stm32CubeProg.upload.params.verbose=
186201tools.stm32CubeProg.upload.params.quiet=
187202tools.stm32CubeProg.upload.pattern="{busybox}" sh "{path}/{cmd}" {upload.protocol} "{build.path}/{build.project_name}.bin" {build.flash_offset} {upload.options}
188203
189204# blackmagic upload for generic STM32
190205tools.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
192207tools.bmp_upload.upload.speed=230400
193208tools.bmp_upload.upload.params.verbose=-batch
194209tools.bmp_upload.upload.params.quiet=--batch-silent
@@ -198,26 +213,19 @@ tools.bmp_upload.upload.pattern.windows="{path}/{cmd}" -nx -b {upload.speed} {up
198213# HID flash 2.2 (HID bootloader v2.2 for STM32F1 and STM32F4 series)
199214tools.hid_upload.cmd=hid-flash
200215tools.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
204216tools.hid_upload.upload.params.verbose=-d
205217tools.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}
207219
208220# Upload using Maple bootloader over DFU
209221tools.maple_upload.script=maple_upload.sh
210- tools.maple_upload.busybox=
211- tools.maple_upload.busybox.windows={path}/win/busybox.exe
212222tools.maple_upload.path={runtime.tools.STM32Tools.path}
213223tools.maple_upload.upload.params.verbose=-d
214224tools.maple_upload.upload.params.quiet=n
215225tools.maple_upload.upload.pattern="{busybox}" sh "{path}/{script}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}.bin"
216226
217227# STM32MP1 self-contained shell script
218228tools.remoteproc_gen.path={runtime.tools.STM32Tools.path}
219- tools.remoteproc_gen.busybox=
220- tools.remoteproc_gen.busybox.windows={path}/win/busybox.exe
221229tools.remoteproc_gen.script=run_arduino_gen.sh
222230tools.remoteproc_gen.upload.params.verbose=
223231tools.remoteproc_gen.upload.params.quiet=
@@ -229,9 +237,9 @@ tools.remoteproc_gen.upload.pattern="{busybox}" sh "{path}/{script}" generate "{
229237# - this is alpha and may be subject to change without notice
230238debug.executable={build.path}/{build.project_name}.elf
231239debug.toolchain=gcc
232- debug.toolchain.path={compiler .path}
240+ debug.toolchain.path={toolchain_dir .path}/bin
233241debug.toolchain.prefix=arm-none-eabi-
234242debug.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
237245debug.server.openocd.script={build.path}/openocd.cfg
0 commit comments