"Error: couldn't bind tcl to socket on port 6666: Address already in use"...
See original GitHub issuehey there đź‘‹
i’m running into a new but familiar error using the recently released v0.3.3 update. here are the steps to reproduce:
- start a new debugging session
- upon completion, click “disconnect”
- start another debugging session
expected debugging session starts, i’m able to pause and step around
actual debugging session fails to start, i get a error dialog saying “Failed to launch OpenOCD GDB Server: Timeout”
having run into this from time to time in the past, i know to check the “Adapter Output” within VSCode where i see:
Open On-Chip Debugger 0.10.0+dev-00920-g6ea43726 (2019-09-09-19:42)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
Error: couldn't bind tcl to socket on port 6666: Address already in use
running lsof -i :6666 returns:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
_openocd 22018 me 3u IPv4 64035 0t0 TCP localhost:6666 (LISTEN)
me@ubuntu:~$
…which confirms that i have an instance of openocd running still despite having ended the debugging session (via the “disconnect” button in VSCode’s debug toolbar).
if i quit that process (via kill <pid>), i’m able to start a new debugging session in VSCode without error.
i’ve seen this in the past (https://github.com/Marus/cortex-debug/issues/81#issuecomment-449185068 and https://github.com/Marus/cortex-debug/issues/181) though the later case was due to my copy of openocd being weird. whereas in the past this would happen something like once every 10 tries (running cortex-debug@0.3.1), it seems to happen 100% of the time now (running cortex-debug@0.3.3)
i’ve confirmed this behavior on:
- macOS
v10.13.6 - ubuntu:
v18.04.3
here’s the VSCode version info:
Version: 1.39.0
Commit: 9df03c6d6ce97c6645c5846f6dfa2a6a7d276515
Date: 2019-10-09T06:58:03.188Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Linux x64 4.15.0-65-generic
Issue Analytics
- State:
- Created 4 years ago
- Comments:14
Top Related StackOverflow Question
I also had the issue but would like to add that v0.3.3 or any older versions did not fix everything for me as my device was previously configured for mesh. I found a solution after multiple resets. Elaborate info for others can be found particle forum
But what I did was
this works now. thanks @busticated for all the help
Note that docs of particle mention problems with mesh. But only tutorial mentions that BLE is also a problem.
May be related, I was having this same error message and it looks like openocd was not exiting cleanly in my machine. I ran
pgrep openocdto find the PID of the still-running process and then killed it. Then I was able to run again.Any reason why openocd is not getting shut down?