Skip to content
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

OpenOCD does not get stopped after the debug session on Windows #1061

Open
boraozgen opened this issue Nov 15, 2024 · 0 comments
Open

OpenOCD does not get stopped after the debug session on Windows #1061

boraozgen opened this issue Nov 15, 2024 · 0 comments

Comments

@boraozgen
Copy link

boraozgen commented Nov 15, 2024

Describe the bug

OpenOCD does not get stopped after the debug session on Windows. This causes the next session to fail with Error: libusb_open() failed with LIBUSB_ERROR_ACCESS.

To Reproduce
Steps to reproduce the behavior:

  1. Start debug session
  2. Stop debug session
  3. Check task manager

Expected behavior

OpenOCD should exit when the debug session is closed.

Environment (please complete the following information):

  • Cortex-Debug: 1.2.1
  • OS: Windows 11
  • GDB Version: GNU gdb (GNU Arm Embedded Toolchain 10.3-2021.10) 10.2.90.20210621-git

Please include launch.json

{
    "name": "Debug openocd",
    "type": "cortex-debug",
    "request": "launch",
    "cwd": "${workspaceRoot}",
    "executable": "${command:cmake.getLaunchTargetPath}",
    "servertype": "openocd",
    "configFiles": [
        "scripts/openocd.cfg",
    ],
    "runToEntryPoint": "main",
}

openocd.cfg

# Interface
source [find interface/stlink.cfg]
# Transport selection
transport select hla_swd
# Target
source [find target/stm32f4x.cfg]

Attach text from Debug Console

Redacting required, will share if needed.

Additional context

As a workaround I added a postDebugTask to the launch config.

{
	"type": "shell",
	"label": "Kill OpenOCD",
	"command": "taskkill",
	"args": [
		"/F",
		"/IM",
		"openocd.exe"
	],
	"problemMatcher": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant