Skip to content

Commit f5ebb1b

Browse files
committed
platform: add postbuild recipe to copy openocd.cfg
Due to several issue with Arduino IDE 2 to expand some properties within Debugger configuration, postbuild recipe is used to copy the openocd.cg from the correct stm32 series. Somes issues have been raised on Arduino IDE GitHub, when solved this recipes should be removed and openocdscript added in the boards.txt. Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 541b224 commit f5ebb1b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

platform.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ extras.path={build.system.path}/extras
119119
# Create {build.opt} if not exists in the output sketch dir and force include of SrcWrapper library
120120
recipe.hooks.prebuild.1.pattern="{extras.path}/prebuild.sh" "{build.path}" "{build.source.path}" "{runtime.platform.path}"
121121
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}"
122+
recipe.hooks.postbuild.1.pattern="{extras.path}/postbuild.sh" "{build.path}" "{build.series}" "{runtime.platform.path}"
123+
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}"
122124

123125
# compile patterns
124126
# ---------------------

system/extras/postbuild.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
BUILD_PATH="$1"
4+
BUILD_SERIE="$2"
5+
BOARD_PLATFORM_PATH="$3"
6+
7+
# Copy the correct openocd.cfg
8+
cp -f "$BOARD_PLATFORM_PATH/variants/$BUILD_SERIE/openocd.cfg" "$BUILD_PATH"

0 commit comments

Comments
 (0)