I’m using a Particle Debugger to debug my Boron application. Or at least I was, until it stopped working.
It was working an hour ago, and I didn’t change the code substantially in any way.
Steps for me to recreate the error:
- With everything powered down, plug in the ribbon cable from the Particle debugger to the Boron
- Power up the PCBA that the Boron is on
- Plug in my Boron and plug in the USB micro from Boron to my PC - PC detects Boron
- Plug in my Particle debugger to my PC - PC detects Particle debugger
- Use “Flash application for debug (local)” command in Particle Workbench
- Compiles fine
- Flashes fines (via usb micro)
- Debug console dumps a bunch of stuff, and after a few seconds I get this error message:
Failed to launch GDB: Remote communication error. Target disconnected.: (undocumented errno 10061). (from target-select extended-remote localhost:50000)
I enabled the "showDevDebugOutput": "raw"
option in launch.json and here is the detailed text that is output to the DEBUG CONSOLE window during the event:
Cortex-Debug: VSCode debugger extension version 1.6.10 git(0458417). Usage info: https://github.com/Marus/cortex-debug#usage
Reading symbols from C:/Users/Boompy/.particle/toolchains/gcc-arm/10.2.1/bin/arm-none-eabi-objdump.exe --syms -C -h -w c:/PARTICLE_LOCAL/LinkApp/target/4.0.1/boron/LinkApp.elf
Reading symbols from c:/users/boompy/.particle/toolchains/gcc-arm/10.2.1/bin/arm-none-eabi-nm.exe --defined-only -S -l -C -p c:/PARTICLE_LOCAL/LinkApp/target/4.0.1/boron/LinkApp.elf
Launching GDB: "C:\\Users\\Boompy\\.particle\\toolchains\\gcc-arm\\10.2.1\\bin\\arm-none-eabi-gdb.exe" -q --interpreter=mi2
1-gdb-version
Launching gdb-server: "C:\\Users\\Boompy\\.particle\\toolchains\\openocd\\0.11.0-particle.4\\bin\\openocd.exe" -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s "C:\\Users\\Boompy\\.particle\\toolchains\\openocd\\0.11.0-particle.4\\share\\openocd\\scripts" -f "c:/Users/Boompy/.vscode/extensions/marus25.cortex-debug-1.6.10/support/openocd-helpers.tcl" -f "interface\\cmsis-dap.cfg" -f "target\\nrf52-particle.cfg" -c "CDRTOSConfigure FreeRTOS"
Please check TERMINAL tab (gdb-server) for output from C:\Users\Boompy\.particle\toolchains\openocd\0.11.0-particle.4\bin\openocd.exe
Finished reading symbols from objdump: Time: 144 ms
C:\Users\Boompy\.particle\toolchains\gcc-arm\10.2.1\bin\arm-none-eabi-gdb.exe: warning: Couldn't determine a path for the index cache directory.
-> =thread-group-added,id="i1"
-> ~"GNU gdb (GNU Arm Embedded Toolchain 10-2020-q4-major) 10.1.90.20201028-git\n"
-> ~"Copyright (C) 2020 Free Software Foundation, Inc.\n"
-> ~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law."
-> ~"\nType \"show copying\" and \"show warranty\" for details.\n"
-> ~"This GDB was configured as \"--host=i686-w64-mingw32 --target=arm-none-eabi\".\n"
-> ~"Type \"show configuration\" for configuration details.\n"
-> ~"For bug reporting instructions, please see:\n"
-> ~"<https://www.gnu.org/software/gdb/bugs/>.\n"
-> ~"Find the GDB manual and other documentation resources online at:\n <http://www.gnu.org/software/gdb/documentation/>."
-> ~"\n\n"
-> ~"For help, type \"help\".\n"
-> ~"Type \"apropos word\" to search for commands related to \"word\".\n"
-> 1^done
2-gdb-set mi-async on
Finished reading symbols from nm: Time: 168 ms
-> 2^done
3-interpreter-exec console "set print demangle on"
-> 3^done
4-interpreter-exec console "set print asm-demangle on"
-> =cmd-param-changed,param="print asm-demangle",value="on"
-> 4^done
5-enable-pretty-printing
-> 5^done
6-interpreter-exec console "source c:/Users/Boompy/.vscode/extensions/marus25.cortex-debug-1.6.10/support/gdbsupport.init"
-> 6^done
7-interpreter-exec console "source c:/Users/Boompy/.vscode/extensions/marus25.cortex-debug-1.6.10/support/gdb-swo.init"
-> =cmd-param-changed,param="language",value="c"
-> =cmd-param-changed,param="language",value="auto"
-> 7^done
8-file-exec-and-symbols "c:/PARTICLE_LOCAL/LinkApp/target/4.0.1/boron/LinkApp.elf"
-> 8^done
9-target-select extended-remote localhost:50000
-> 9^error,msg="Remote communication error. Target disconnected.: (undocumented errno 10061)."
10-interpreter-exec console "monitor halt"
Failed to launch GDB: Remote communication error. Target disconnected.: (undocumented errno 10061). (from target-select extended-remote localhost:50000)
here is my launch.json file:
{
"version": "0.1.0",
"configurations": [
{
"type": "cortex-debug",
"request": "attach",
"servertype": "openocd",
"name": "Particle Debugger",
"showDevDebugOutput": "raw",
"cwd": "${workspaceRoot}",
"rtos": "FreeRTOS",
"armToolchainPath": "${command:particle.getDebuggerCompilerDir}",
"executable": "${command:particle.getDebuggerExecutable}",
"serverpath": "${command:particle.getDebuggerOpenocdPath}",
"preLaunchTask": "Particle: Flash application for debug (local)",
"searchDir": [
"${command:particle.getDebuggerSearchDir}"
],
"configFiles": [
"${command:particle.getDebuggerConfigFiles}"
],
"postAttachCommands": [
"${command:particle.getDebuggerPostAttachCommands}"
],
"particle": {
"version": "1.0.1",
"debugger": "particle-debugger"
}
},
{
"type": "cortex-debug",
"request": "attach",
"servertype": "openocd",
"name": "Particle Programmer Shield",
"cwd": "${workspaceRoot}",
"rtos": "FreeRTOS",
"armToolchainPath": "${command:particle.getDebuggerCompilerDir}",
"executable": "${command:particle.getDebuggerExecutable}",
"serverpath": "${command:particle.getDebuggerOpenocdPath}",
"preLaunchTask": "Particle: Flash application for debug (local)",
"searchDir": [
"${command:particle.getDebuggerSearchDir}"
],
"configFiles": [
"${command:particle.getDebuggerConfigFiles}"
],
"postAttachCommands": [
"${command:particle.getDebuggerPostAttachCommands}"
],
"particle": {
"version": "1.0.1",
"debugger": "particle-programmer-shield"
}
},
{
"type": "cortex-debug",
"request": "attach",
"servertype": "openocd",
"name": "Generic DAPLink Compatible Debugger",
"cwd": "${workspaceRoot}",
"rtos": "FreeRTOS",
"armToolchainPath": "${command:particle.getDebuggerCompilerDir}",
"executable": "${command:particle.getDebuggerExecutable}",
"serverpath": "${command:particle.getDebuggerOpenocdPath}",
"preLaunchTask": "Particle: Flash application for debug (local)",
"searchDir": [
"${command:particle.getDebuggerSearchDir}"
],
"configFiles": [
"${command:particle.getDebuggerConfigFiles}"
],
"postAttachCommands": [
"${command:particle.getDebuggerPostAttachCommands}"
],
"particle": {
"version": "1.0.1",
"debugger": "generic-cmsis-dap"
}
},
{
"type": "cortex-debug",
"request": "attach",
"servertype": "openocd",
"name": "[outdated] Particle Debugger",
"cwd": "${workspaceRoot}",
"armToolchainPath": "${command:particle.getDebuggerCompilerDir}",
"executable": "${command:particle.getDebuggerExecutable}",
"serverpath": "${command:particle.getDebuggerOpenocdPath}",
"preLaunchTask": "Particle: Flash application for debug (local)",
"searchDir": [
"${command:particle.getDebuggerSearchDir}"
],
"configFiles": [
"${command:particle.getDebuggerConfigFiles}"
],
"postAttachCommands": [
"${command:particle.getDebuggerPostAttachCommands}"
],
"particle": {
"version": "1.0.0",
"debugger": "particle-debugger"
}
},
{
"type": "cortex-debug",
"request": "attach",
"servertype": "openocd",
"name": "[outdated] Particle Programmer Shield",
"cwd": "${workspaceRoot}",
"armToolchainPath": "${command:particle.getDebuggerCompilerDir}",
"executable": "${command:particle.getDebuggerExecutable}",
"serverpath": "${command:particle.getDebuggerOpenocdPath}",
"preLaunchTask": "Particle: Flash application for debug (local)",
"searchDir": [
"${command:particle.getDebuggerSearchDir}"
],
"configFiles": [
"${command:particle.getDebuggerConfigFiles}"
],
"postAttachCommands": [
"${command:particle.getDebuggerPostAttachCommands}"
],
"particle": {
"version": "1.0.0",
"debugger": "particle-programmer-shield"
}
},
{
"type": "cortex-debug",
"request": "attach",
"servertype": "openocd",
"name": "[outdated] Generic DAPLink Compatible Debugger",
"cwd": "${workspaceRoot}",
"armToolchainPath": "${command:particle.getDebuggerCompilerDir}",
"executable": "${command:particle.getDebuggerExecutable}",
"serverpath": "${command:particle.getDebuggerOpenocdPath}",
"preLaunchTask": "Particle: Flash application for debug (local)",
"searchDir": [
"${command:particle.getDebuggerSearchDir}"
],
"configFiles": [
"${command:particle.getDebuggerConfigFiles}"
],
"postAttachCommands": [
"${command:particle.getDebuggerPostAttachCommands}"
],
"particle": {
"version": "1.0.0",
"debugger": "generic-cmsis-dap"
}
},
{
"type": "cortex-debug",
"request": "attach",
"name": "[outdated] Particle Debugger (photon, p1, electron)",
"servertype": "openocd",
"interface": "swd",
"device": "STM32F205RG",
"cwd": "${workspaceRoot}",
"executable": "${command:particle.getDebuggerExecutable}",
"preLaunchTask": "Particle: Flash application for debug (local)",
"armToolchainPath": "${command:particle.getDebuggerCompilerDir}",
"svdFile": "${command:particle.getDebuggerSVDFile}",
"searchDir": [
"${command:particle.getDebuggerSearchDir}"
],
"configFiles": [
"interface/cmsis-dap.cfg",
"target/stm32f2x.cfg"
],
"postAttachCommands": [
"monitor reset halt"
],
"windows": {
"configFiles": [
"interface\\cmsis-dap.cfg",
"target\\stm32f2x.cfg"
]
}
},
{
"type": "cortex-debug",
"request": "attach",
"name": "[outdated] Particle Debugger (argon, boron / bsom / b5som, xenon, tracker)",
"servertype": "openocd",
"interface": "swd",
"device": "nRF52840_xxAA",
"cwd": "${workspaceRoot}",
"executable": "${command:particle.getDebuggerExecutable}",
"preLaunchTask": "Particle: Flash application for debug (local)",
"armToolchainPath": "${command:particle.getDebuggerCompilerDir}",
"svdFile": "${command:particle.getDebuggerSVDFile}",
"searchDir": [
"${command:particle.getDebuggerSearchDir}"
],
"configFiles": [
"interface/cmsis-dap.cfg",
"target/nrf52-particle.cfg"
],
"postAttachCommands": [
"monitor reset halt"
],
"windows": {
"configFiles": [
"interface\\cmsis-dap.cfg",
"target\\nrf52-particle.cfg"
]
}
},
{
"type": "cortex-debug",
"request": "attach",
"name": "[outdated] Particle Programmer Shield v1.0 (photon, p1, electron)",
"servertype": "openocd",
"interface": "swd",
"device": "STM32F205RG",
"cwd": "${workspaceRoot}",
"executable": "${command:particle.getDebuggerExecutable}",
"preLaunchTask": "Particle: Flash application for debug (local)",
"armToolchainPath": "${command:particle.getDebuggerCompilerDir}",
"svdFile": "${command:particle.getDebuggerSVDFile}",
"searchDir": [
"${command:particle.getDebuggerSearchDir}"
],
"configFiles": [
"interface/particle-ftdi.cfg",
"target/stm32f2x.cfg"
],
"postAttachCommands": [
"monitor reset halt"
],
"windows": {
"configFiles": [
"interface\\particle-ftdi.cfg",
"target\\stm32f2x.cfg"
]
}
}
]
}
EDIT
OK, I figured it out at least partially.
The problem only presents itself when I have my other debugger plugged in at the same time - and Atmel ICE.
I am trying to debug the Boron at the same time as another custom board (using the Atmel ICE) but it appears that the Particle Debugger can’t attach/launch to Boron when the Atmel-ICE is plugged in.
If I start a debug session on the Boron with Atmel-ICE unplugged, the Particle Debugger successfully and repeatably establishes the debug session.
If I then plug in the Atmel-ICE once the Particle debug session is underway, I can also successfully start a debug session with my SAMG55 micro via the Atmel-ICE.
So the questions has become: Is there a way to get Workbench/VSCode to successfully launch/attach while I have my other debugger plugged in (i.e. tell Workbench to use a different set of ports to launch the debug session)