Skip to content

openocd.scripts_dir seems not used #2746

@fpistm

Description

@fpistm

Describe the problem

Hi;
Trying to use an other openocd version where scripts folder is at a different base directory.
When launching the debug it fails because it could not find the interface.
Looking at the generated config and the command line, the openocd.scripts_dir is not present.
Editing manually the launch.json generated, and adding the searchDir options with the value of openocd.scripts_dir allows to debug.

"searchDir": ["/local/ST/stm32cubeide_1.13.1/plugins/com.st.stm32cube.ide.mcu.debug.openocd_2.3.100.202501240831/resources/openocd/st_scripts"],

To reproduce

Here the change made in platform.txt to pint to the openocd provided within STM32CubeIDE

@@ -15,11 +15,11 @@ tool_suffix.windows=.exe
 
 busybox=
 busybox.windows={runtime.tools.STM32Tools.path}/win/busybox.exe
 
 toolchain_dir={runtime.tools.xpack-arm-none-eabi-gcc-14.2.1-1.1.path}
-openocd_dir={runtime.tools.xpack-openocd-0.12.0-6.path}
+openocd_dir=/local/ST/stm32cubeide_1.13.1/plugins/com.st.stm32cube.ide.mcu.externaltools.openocd.linux64_2.4.100.202501161620/tools/
 
 tools_bin_path.windows={runtime.tools.STM32Tools.path}/win
 tools_bin_path.macosx={runtime.tools.STM32Tools.path}/macosx
 tools_bin_path.linux={runtime.tools.STM32Tools.path}/linux
 
@@ -253,10 +253,10 @@ debug.executable={build.path}/{build.project_name}.elf
 debug.toolchain=gcc
 debug.toolchain.path={toolchain_dir}/bin
 debug.toolchain.prefix=arm-none-eabi
 debug.server=openocd
 debug.server.openocd.path={openocd_dir}/bin/openocd
-debug.server.openocd.scripts_dir={openocd_dir}/openocd/scripts
+debug.server.openocd.scripts_dir=/local/ST/stm32cubeide_1.13.1/plugins/com.st.stm32cube.ide.mcu.debug.openocd_2.3.100.202501240831/resources/openocd/st_scripts
 # Common config
-debug.server.openocd.scripts.0=interface/stlink.cfg
+debug.server.openocd.scripts.0=interface/stlink-dap.cfg
 debug.server.openocd.scripts.1={runtime.platform.path}/debugger/select_dapdirect.cfg
 debug.server.openocd.scripts.2=target/{openocd.target}.cfg

Expected behavior

"searchDir" should be added to the generated configuration using the openocd.scripts_dir value.

Arduino IDE version

2.3.6

Operating system

Linux

Operating system version

Ubuntu 22.04

Additional context

debug.server.openocd.scripts_dir descrption here: https://arduino.github.io/arduino-cli/1.2/platform-specification/#debugger-configuration-directives

Issue checklist

  • I searched for previous reports in
    I verified the problem still occurs when using the latest
    My report contains all necessary details

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @fpistm

        Issue actions

          openocd.scripts_dir seems not used · Issue #2746 · arduino/arduino-ide