question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Shutdown openocd when stopping debug session?

See original GitHub issue

I’m not sure if I’m doing something wrong; when I stop the cortex-debug 0.3.7+openocd session, gdb is shutdown, but openocd is left running. Starting a new debug session fails until I manually kill the already running openocd.exe process. I’m using scoop on Windows to install openocd & gcc/gdb:

gcc-arm-none-eabi 10-2020-q4-major [extras]
openocd 0.10.0 [extras]

This happens with request set to “launch” or “attach”

I get a Failed to launch OpenOCD GDB Server: Timeout. popup, with openocd reporting the following on the Output tab:

Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
Error: open failed
in procedure 'init' 
in procedure 'ocd_bouncer'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:10

github_iconTop GitHub Comments

1reaction
haneefdmcommented, Dec 22, 2021

This should have been fixed a while ago. Please let us know (reopen) if this is still a problem

For openocd, you can use monitor [target current] configure -event gdb-detach {shutdown} in your configuration file and this will exit openocd when gdb-detaches. However, it will cause anyone else connected to OpenOCD as well.

1reaction
jhillyerdcommented, Dec 31, 2020

One workaround I’ve found, type mon shutdown at the gdb prompt, while the MCU is paused, then stop the debug session. Klunky, and it doesn’t always work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

General Commands (OpenOCD User's Guide)
If user types CTRL-C or kills OpenOCD, the command shutdown will be automatically executed to cause OpenOCD to exit. It is possible to...
Read more >
Developers - Shutdown openocd when stopping debug session? -
I'm not sure if I'm doing something wrong; when I stop the cortex-debug 0.3.7+openocd session, gdb is shutdown, but openocd is left running....
Read more >
Thread: [OpenOCD-user] How to cleanly shut ... - SourceForge
When I close GDB, OpenOCD automatically shuts down. ... in the background, why do you want to stop and restart it every debug...
Read more >
GDB Disconnects when trying to debug via openocd
I get this pop up: "OpenOCD GDB Server Quit Unexpectedly. See gdb-server output for more details." And this message in the terminal: Open...
Read more >
The SEGGER J-Link debugging plug-in
How to run Eclipse debug sessions using the SEGGER J-Link. ... integration of the GDB server, automatically started/stopped for each debug session ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found