Skip to content

Add debug openocd #1976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CI/update/stm32variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
15 changes: 15 additions & 0 deletions platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ---------------------
Expand Down Expand Up @@ -215,3 +217,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
8 changes: 8 additions & 0 deletions system/extras/postbuild.sh
Original file line number Diff line number Diff line change
@@ -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"
17 changes: 17 additions & 0 deletions variants/STM32F0xx/openocd.cfg
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions variants/STM32F1xx/openocd.cfg
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions variants/STM32F2xx/openocd.cfg
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions variants/STM32F3xx/openocd.cfg
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions variants/STM32F4xx/openocd.cfg
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions variants/STM32F7xx/openocd.cfg
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions variants/STM32G0xx/openocd.cfg
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions variants/STM32G4xx/openocd.cfg
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions variants/STM32H7xx/openocd.cfg
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions variants/STM32L0xx/openocd.cfg
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions variants/STM32L1xx/openocd.cfg
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions variants/STM32L4xx/openocd.cfg
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions variants/STM32L5xx/openocd.cfg
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions variants/STM32MP1xx/openocd.cfg
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions variants/STM32U5xx/openocd.cfg
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions variants/STM32WBxx/openocd.cfg
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions variants/STM32WLxx/openocd.cfg
Original file line number Diff line number Diff line change
@@ -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