From 541b224fba3d81e826373c4f6f3cc024dc138134 Mon Sep 17 00:00:00 2001 From: Guillaume Gautier Date: Tue, 14 Mar 2023 17:22:23 +0100 Subject: [PATCH 1/4] platform: add openocd debug feature to platform.txt Signed-off-by: Guillaume Gautier --- platform.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/platform.txt b/platform.txt index d64b3741bf..5ffea8e523 100644 --- a/platform.txt +++ b/platform.txt @@ -215,3 +215,16 @@ tools.remoteproc_gen.script=run_arduino_gen.sh tools.remoteproc_gen.upload.params.verbose= tools.remoteproc_gen.upload.params.quiet= tools.remoteproc_gen.upload.pattern="{busybox}" sh "{path}/{script}" generate "{build.path}/{build.project_name}.elf" "{build.path}/run_arduino_{build.project_name}.sh" + +# 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 From 63d567d63b4deb9e82e4257d7e14d9994479d0f4 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Fri, 17 Mar 2023 15:51:39 +0100 Subject: [PATCH 2/4] 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 --- platform.txt | 2 ++ system/extras/postbuild.sh | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100755 system/extras/postbuild.sh diff --git a/platform.txt b/platform.txt index 5ffea8e523..b86d062ef5 100644 --- a/platform.txt +++ b/platform.txt @@ -119,6 +119,8 @@ 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 # --------------------- diff --git a/system/extras/postbuild.sh b/system/extras/postbuild.sh new file mode 100755 index 0000000000..47e7c32630 --- /dev/null +++ b/system/extras/postbuild.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +BUILD_PATH="$1" +BUILD_SERIE="$2" +BOARD_PLATFORM_PATH="$3" + +# Copy the correct openocd.cfg +cp -f "$BOARD_PLATFORM_PATH/variants/$BUILD_SERIE/openocd.cfg" "$BUILD_PATH" From 92a4986d5a41f6a04f8adf5de13cf34f9e474e9a Mon Sep 17 00:00:00 2001 From: Guillaume Gautier Date: Wed, 15 Mar 2023 09:04:39 +0100 Subject: [PATCH 3/4] variants: add all openocd.cfg for all series (except c0) STM32C0 has no target cfg file in openocd scripts directory. For all other variants, the openocd file is added. Signed-off-by: Guillaume Gautier --- variants/STM32F0xx/openocd.cfg | 17 +++++++++++++++++ variants/STM32F1xx/openocd.cfg | 17 +++++++++++++++++ variants/STM32F2xx/openocd.cfg | 17 +++++++++++++++++ variants/STM32F3xx/openocd.cfg | 17 +++++++++++++++++ variants/STM32F4xx/openocd.cfg | 17 +++++++++++++++++ variants/STM32F7xx/openocd.cfg | 17 +++++++++++++++++ variants/STM32G0xx/openocd.cfg | 17 +++++++++++++++++ variants/STM32G4xx/openocd.cfg | 17 +++++++++++++++++ variants/STM32H7xx/openocd.cfg | 17 +++++++++++++++++ variants/STM32L0xx/openocd.cfg | 17 +++++++++++++++++ variants/STM32L1xx/openocd.cfg | 17 +++++++++++++++++ variants/STM32L4xx/openocd.cfg | 17 +++++++++++++++++ variants/STM32L5xx/openocd.cfg | 17 +++++++++++++++++ variants/STM32MP1xx/openocd.cfg | 17 +++++++++++++++++ variants/STM32U5xx/openocd.cfg | 17 +++++++++++++++++ variants/STM32WBxx/openocd.cfg | 17 +++++++++++++++++ variants/STM32WLxx/openocd.cfg | 17 +++++++++++++++++ 17 files changed, 289 insertions(+) create mode 100644 variants/STM32F0xx/openocd.cfg create mode 100644 variants/STM32F1xx/openocd.cfg create mode 100644 variants/STM32F2xx/openocd.cfg create mode 100644 variants/STM32F3xx/openocd.cfg create mode 100644 variants/STM32F4xx/openocd.cfg create mode 100644 variants/STM32F7xx/openocd.cfg create mode 100644 variants/STM32G0xx/openocd.cfg create mode 100644 variants/STM32G4xx/openocd.cfg create mode 100644 variants/STM32H7xx/openocd.cfg create mode 100644 variants/STM32L0xx/openocd.cfg create mode 100644 variants/STM32L1xx/openocd.cfg create mode 100644 variants/STM32L4xx/openocd.cfg create mode 100644 variants/STM32L5xx/openocd.cfg create mode 100644 variants/STM32MP1xx/openocd.cfg create mode 100644 variants/STM32U5xx/openocd.cfg create mode 100644 variants/STM32WBxx/openocd.cfg create mode 100644 variants/STM32WLxx/openocd.cfg diff --git a/variants/STM32F0xx/openocd.cfg b/variants/STM32F0xx/openocd.cfg new file mode 100644 index 0000000000..d826582f1e --- /dev/null +++ b/variants/STM32F0xx/openocd.cfg @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023, STMicroelectronics +# All rights reserved. +# +# This software component is licensed by ST under BSD 3-Clause license, +# the "License"; You may not use this file except in compliance with the +# License. You may obtain a copy of the License at: +# opensource.org/licenses/BSD-3-Clause +# + +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32f0x.cfg] + +reset_config srst_only diff --git a/variants/STM32F1xx/openocd.cfg b/variants/STM32F1xx/openocd.cfg new file mode 100644 index 0000000000..5687d45953 --- /dev/null +++ b/variants/STM32F1xx/openocd.cfg @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023, STMicroelectronics +# All rights reserved. +# +# This software component is licensed by ST under BSD 3-Clause license, +# the "License"; You may not use this file except in compliance with the +# License. You may obtain a copy of the License at: +# opensource.org/licenses/BSD-3-Clause +# + +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32f1x.cfg] + +reset_config srst_only diff --git a/variants/STM32F2xx/openocd.cfg b/variants/STM32F2xx/openocd.cfg new file mode 100644 index 0000000000..daa416cb2a --- /dev/null +++ b/variants/STM32F2xx/openocd.cfg @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023, STMicroelectronics +# All rights reserved. +# +# This software component is licensed by ST under BSD 3-Clause license, +# the "License"; You may not use this file except in compliance with the +# License. You may obtain a copy of the License at: +# opensource.org/licenses/BSD-3-Clause +# + +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32f2x.cfg] + +reset_config srst_only diff --git a/variants/STM32F3xx/openocd.cfg b/variants/STM32F3xx/openocd.cfg new file mode 100644 index 0000000000..95e3d0eab0 --- /dev/null +++ b/variants/STM32F3xx/openocd.cfg @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023, STMicroelectronics +# All rights reserved. +# +# This software component is licensed by ST under BSD 3-Clause license, +# the "License"; You may not use this file except in compliance with the +# License. You may obtain a copy of the License at: +# opensource.org/licenses/BSD-3-Clause +# + +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32f3x.cfg] + +reset_config srst_only diff --git a/variants/STM32F4xx/openocd.cfg b/variants/STM32F4xx/openocd.cfg new file mode 100644 index 0000000000..f4754d9143 --- /dev/null +++ b/variants/STM32F4xx/openocd.cfg @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023, STMicroelectronics +# All rights reserved. +# +# This software component is licensed by ST under BSD 3-Clause license, +# the "License"; You may not use this file except in compliance with the +# License. You may obtain a copy of the License at: +# opensource.org/licenses/BSD-3-Clause +# + +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32f4x.cfg] + +reset_config srst_only diff --git a/variants/STM32F7xx/openocd.cfg b/variants/STM32F7xx/openocd.cfg new file mode 100644 index 0000000000..9f1f9665e1 --- /dev/null +++ b/variants/STM32F7xx/openocd.cfg @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023, STMicroelectronics +# All rights reserved. +# +# This software component is licensed by ST under BSD 3-Clause license, +# the "License"; You may not use this file except in compliance with the +# License. You may obtain a copy of the License at: +# opensource.org/licenses/BSD-3-Clause +# + +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32f7x.cfg] + +reset_config srst_only diff --git a/variants/STM32G0xx/openocd.cfg b/variants/STM32G0xx/openocd.cfg new file mode 100644 index 0000000000..fbb7eb4ad6 --- /dev/null +++ b/variants/STM32G0xx/openocd.cfg @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023, STMicroelectronics +# All rights reserved. +# +# This software component is licensed by ST under BSD 3-Clause license, +# the "License"; You may not use this file except in compliance with the +# License. You may obtain a copy of the License at: +# opensource.org/licenses/BSD-3-Clause +# + +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32g0x.cfg] + +reset_config srst_only diff --git a/variants/STM32G4xx/openocd.cfg b/variants/STM32G4xx/openocd.cfg new file mode 100644 index 0000000000..8ff69bca04 --- /dev/null +++ b/variants/STM32G4xx/openocd.cfg @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023, STMicroelectronics +# All rights reserved. +# +# This software component is licensed by ST under BSD 3-Clause license, +# the "License"; You may not use this file except in compliance with the +# License. You may obtain a copy of the License at: +# opensource.org/licenses/BSD-3-Clause +# + +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32g4x.cfg] + +reset_config srst_only diff --git a/variants/STM32H7xx/openocd.cfg b/variants/STM32H7xx/openocd.cfg new file mode 100644 index 0000000000..9bfdded39c --- /dev/null +++ b/variants/STM32H7xx/openocd.cfg @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023, STMicroelectronics +# All rights reserved. +# +# This software component is licensed by ST under BSD 3-Clause license, +# the "License"; You may not use this file except in compliance with the +# License. You may obtain a copy of the License at: +# opensource.org/licenses/BSD-3-Clause +# + +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32h7x.cfg] + +reset_config srst_only diff --git a/variants/STM32L0xx/openocd.cfg b/variants/STM32L0xx/openocd.cfg new file mode 100644 index 0000000000..def6a13b35 --- /dev/null +++ b/variants/STM32L0xx/openocd.cfg @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023, STMicroelectronics +# All rights reserved. +# +# This software component is licensed by ST under BSD 3-Clause license, +# the "License"; You may not use this file except in compliance with the +# License. You may obtain a copy of the License at: +# opensource.org/licenses/BSD-3-Clause +# + +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32l0.cfg] + +reset_config srst_only diff --git a/variants/STM32L1xx/openocd.cfg b/variants/STM32L1xx/openocd.cfg new file mode 100644 index 0000000000..19c15f2b26 --- /dev/null +++ b/variants/STM32L1xx/openocd.cfg @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023, STMicroelectronics +# All rights reserved. +# +# This software component is licensed by ST under BSD 3-Clause license, +# the "License"; You may not use this file except in compliance with the +# License. You may obtain a copy of the License at: +# opensource.org/licenses/BSD-3-Clause +# + +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32l1.cfg] + +reset_config srst_only diff --git a/variants/STM32L4xx/openocd.cfg b/variants/STM32L4xx/openocd.cfg new file mode 100644 index 0000000000..94127ecb98 --- /dev/null +++ b/variants/STM32L4xx/openocd.cfg @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023, STMicroelectronics +# All rights reserved. +# +# This software component is licensed by ST under BSD 3-Clause license, +# the "License"; You may not use this file except in compliance with the +# License. You may obtain a copy of the License at: +# opensource.org/licenses/BSD-3-Clause +# + +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32l4x.cfg] + +reset_config srst_only diff --git a/variants/STM32L5xx/openocd.cfg b/variants/STM32L5xx/openocd.cfg new file mode 100644 index 0000000000..20a24ac69c --- /dev/null +++ b/variants/STM32L5xx/openocd.cfg @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023, STMicroelectronics +# All rights reserved. +# +# This software component is licensed by ST under BSD 3-Clause license, +# the "License"; You may not use this file except in compliance with the +# License. You may obtain a copy of the License at: +# opensource.org/licenses/BSD-3-Clause +# + +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32l5x.cfg] + +reset_config srst_only diff --git a/variants/STM32MP1xx/openocd.cfg b/variants/STM32MP1xx/openocd.cfg new file mode 100644 index 0000000000..60c4c7db50 --- /dev/null +++ b/variants/STM32MP1xx/openocd.cfg @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023, STMicroelectronics +# All rights reserved. +# +# This software component is licensed by ST under BSD 3-Clause license, +# the "License"; You may not use this file except in compliance with the +# License. You may obtain a copy of the License at: +# opensource.org/licenses/BSD-3-Clause +# + +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32mp15x.cfg] + +reset_config srst_only diff --git a/variants/STM32U5xx/openocd.cfg b/variants/STM32U5xx/openocd.cfg new file mode 100644 index 0000000000..587f7aa8d3 --- /dev/null +++ b/variants/STM32U5xx/openocd.cfg @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023, STMicroelectronics +# All rights reserved. +# +# This software component is licensed by ST under BSD 3-Clause license, +# the "License"; You may not use this file except in compliance with the +# License. You may obtain a copy of the License at: +# opensource.org/licenses/BSD-3-Clause +# + +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32u5x.cfg] + +reset_config srst_only diff --git a/variants/STM32WBxx/openocd.cfg b/variants/STM32WBxx/openocd.cfg new file mode 100644 index 0000000000..f835c16689 --- /dev/null +++ b/variants/STM32WBxx/openocd.cfg @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023, STMicroelectronics +# All rights reserved. +# +# This software component is licensed by ST under BSD 3-Clause license, +# the "License"; You may not use this file except in compliance with the +# License. You may obtain a copy of the License at: +# opensource.org/licenses/BSD-3-Clause +# + +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32wbx.cfg] + +reset_config srst_only diff --git a/variants/STM32WLxx/openocd.cfg b/variants/STM32WLxx/openocd.cfg new file mode 100644 index 0000000000..4ccd7efa18 --- /dev/null +++ b/variants/STM32WLxx/openocd.cfg @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023, STMicroelectronics +# All rights reserved. +# +# This software component is licensed by ST under BSD 3-Clause license, +# the "License"; You may not use this file except in compliance with the +# License. You may obtain a copy of the License at: +# opensource.org/licenses/BSD-3-Clause +# + +source [find interface/stlink.cfg] + +transport select hla_swd + +source [find target/stm32wlx.cfg] + +reset_config srst_only From 2072d87fb6c11715899d16de9c05c8ab45b72375 Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Fri, 17 Mar 2023 15:52:51 +0100 Subject: [PATCH 4/4] ci(stm32variant): list only directories Signed-off-by: Frederic Pillon --- CI/update/stm32variant.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/update/stm32variant.py b/CI/update/stm32variant.py index 65a1ec76b5..2d6c80fa7b 100644 --- a/CI/update/stm32variant.py +++ b/CI/update/stm32variant.py @@ -2063,7 +2063,7 @@ def aggregate_dir(): # Get all mcu_dir mcu_dirs = sorted(mcu_family.glob("*/")) # Get original directory list of current serie STM32YYxx - mcu_out_dirs_ori = sorted(out_family_path.glob("*/")) + mcu_out_dirs_ori = sorted(out_family_path.glob("*/**")) mcu_out_dirs_up = [] # Group mcu directories when only expressions and xml file name are different while mcu_dirs: