[ISSUE] Failed to launch OpenOCD GDB Server: Timeout

hey all :wave:

it seems the extension we depend on to drive debugging - cortex-debug - released an update this morning that broke our integration (details here). if you are using v0.2.4 of the Cortext Debug (one of Particle Workbench’s extension dependencies), debugging will not work.

38%20AM

we’ll be working to get a fix out ASAP but in the meantime, the work-around is to use VSCode’s “Install Another Version” option to revert the “Cortex Debug” extension back to v0.2.3:

  1. From VSCode’s main menu select “View > Extensions”

  2. Disable automatic extension updates: Click the three-dot menu (...) in the middle column and select “Disable Auto Updating Extensions”

  1. Find the “Cortext Debug” extension: Click the three-dot menu (...), select “Show Installed Extensions”

  2. Install the 0.2.3 version of cortex-debug: Click the GEAR icon next to the “Cortex Debug” entry, click “Install Another Version”, and select 0.2.3 in the picker menu that launches

hope it helps - apologies for the bumps :pray::+1:

3 Likes

as of Workbench v1.5.0, this should be resolved - if you’ve disabled automatic updates for extensions, go ahead and re-enable them and you should see the update download and install :+1:

@m_m I have the same issue :open_mouth:
Workbench 1.5.0
Cortex-Debug 0.3.1

Any hints?

:thinking: hm. well, that’s no fun.

it’s working over here (though i realize that’s not super-helpful) so i don’t think you are hitting the original issue captured in this thread.

regardless, let’s see if we can get you back on track.

first, generate an audit report: run the Particle: Audit Environment command (docs)

go ahead share the non-sensitive portions of that report here.

next, are you able to successfully run the local compiler (docs)? from VSCode’s main menu, select “Terminal > Run Task…” then pick the Particle: Compile application & DeviceOS (local) task from the list presented.

then, are you able to successfully flash using the local compiler? again from VSCode’s main menu, select: “Terminal > Run Task…” and pick Particle: Flash application & DeviceOS (local) from the list presented.

now, let’s clean all the things - “Terminal > Run Task…” then pick Particle: Clean application & DeviceOS (local)

assuming all of that works, let’s run through the debugging steps for your Particle device:

photon, electron, p1

OR

argon, boron, xenon, bsom

at which point does your error appear?

things to double-check: your device is connected via USB, your USB cable is known-good, the environment audit report shows ok: true across the board.

Hey @m_m I’m seeing this error on Linux and Mac. Here is the audit from Linux.

I tried the workaround, it didn’t change anything, so I switched back to 0.3.1 of cortex-debug.

{
    "username": "nrobinson2000@me.com",
    "workspace": {
        "name": "tcp-test",
        "isWorkspace": false,
        "folders": [
            {
                "location": "/home/nrobinson/projects/tcp-test",
                "hasValidPath": true,
                "settings": {
                    "firmwareName": "deviceOS",
                    "firmwareVersion": "1.4.0",
                    "targetDevice": "roadshow",
                    "targetPlatform": "argon",
                    "compileButtonAction": "localAppDeviceOS",
                    "flashButtonAction": "localAppDeviceOS",
                    "disableWelcomeScreen": true,
                    "disableLocalCompilerDirtyCheck": true,
                    "enableVerboseLocalCompilerLogging": false
                },
                "files": [
                    ".vscode",
                    ".vscode/launch.json",
                    ".vscode/settings.json",
                    "README.md",
                    "project.properties",
                    "src",
                    "src/debug.cpp",
                    "src/tcp-test.cpp.temp",
                    "target",
                    "target/obj",
                    "target/tcp-test.bin",
                    "target/tcp-test.bin.crc_block",
                    "target/tcp-test.bin.no_crc",
                    "target/tcp-test.dfu",
                    "target/tcp-test.elf",
                    "target/tcp-test.hex",
                    "target/tcp-test.lst",
                    "target/tcp-test.map"
                ]
            }
        ]
    },
    "cli": {
        "binpath": "/home/nrobinson/.vscode/extensions/particle.particle-vscode-core-1.5.4/src/cli/bin/linux/amd64/particle",
        "ok": true,
        "version": "1.47.0",
        "installed": 1567886573663
    },
    "localCompiler": {
        "ok": true,
        "dependencies": [
            {
                "id": "deviceOS@1.4.0",
                "ok": true
            },
            {
                "id": "gcc-arm@5.3.1",
                "ok": true
            },
            {
                "id": "buildtools@1.1.0",
                "ok": true
            },
            {
                "id": "buildscripts@1.6.1",
                "ok": true
            },
            {
                "id": "openocd@0.11.2-adhoc6ea4372.0",
                "ok": true
            },
            {
                "id": "deviceOS@1.3.1",
                "ok": true
            },
            {
                "id": "deviceOS@1.1.0",
                "ok": true
            },
            {
                "id": "deviceOS@1.0.1",
                "ok": true
            },
            {
                "id": "deviceOS@0.8.0-rc.10",
                "ok": true
            },
            {
                "id": "deviceOS@0.7.0",
                "ok": true
            }
        ]
    },
    "platform": {
        "os": "linux",
        "type": "Linux",
        "release": "4.15.0-62-generic",
        "arch": "x64",
        "path": {
            "key": "PATH",
            "value": "/home/nrobinson/Downloads/node_modules/.bin:/home/nrobinson/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/.mount_ParticaowWhW:/tmp/.mount_ParticaowWhW:/tmp/.mount_ParticaowWhW/usr/sbin:/home/nrobinson/.cargo/bin:/home/nrobinson/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
        },
        "homeDir": "/home/nrobinson",
        "particleDir": "/home/nrobinson/.particle",
        "localCompilerToolchainDir": "/home/nrobinson/.particle/toolchains"
    },
    "env": {
        "LD_LIBRARY_PATH": "/tmp/.mount_ParticaowWhW/usr/lib:",
        "INSIDE_NEMO_PYTHON": "",
        "LANG": "en_US.UTF-8",
        "GDM_LANG": "en_US",
        "DISPLAY": ":0",
        "APPIMAGE": "/home/nrobinson/Downloads/ParticleWorkbenchInstaller.AppImage",
        "GTK_OVERLAY_SCROLLING": "1",
        "CHROME_DESKTOP": "Particle Workbench Installer.desktop",
        "NO_AT_BRIDGE": "1",
        "XDG_VTNR": "7",
        "GIO_LAUNCHED_DESKTOP_FILE_PID": "4568",
        "SSH_AUTH_SOCK": "/run/user/1000/keyring/ssh",
        "MANDATORY_PATH": "/usr/share/gconf/cinnamon.mandatory.path",
        "XDG_SESSION_ID": "c2",
        "XDG_GREETER_DATA_DIR": "/var/lib/lightdm-data/nrobinson",
        "USER": "nrobinson",
        "DESKTOP_SESSION": "cinnamon",
        "DEFAULTS_PATH": "/usr/share/gconf/cinnamon.default.path",
        "QT_QPA_PLATFORMTHEME": "qt5ct",
        "PWD": "/home/nrobinson/Downloads",
        "HOME": "/home/nrobinson",
        "SSH_AGENT_PID": "2042",
        "QT_ACCESSIBILITY": "1",
        "XDG_SESSION_TYPE": "x11",
        "XDG_DATA_DIRS": "/tmp/.mount_ParticaowWhW/usr/share/:./share/:/usr/share/gnome:/usr/local/share/:/usr/share/:/usr/share/cinnamon:/usr/share/gnome:/home/nrobinson/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop:/usr/share/gnome/:/usr/local/share/:/usr/share/",
        "GSETTINGS_SCHEMA_DIR": "/tmp/.mount_ParticaowWhW/usr/share/glib-2.0/schemas:",
        "XDG_SESSION_DESKTOP": "cinnamon",
        "ARGV0": "/home/nrobinson/Downloads/ParticleWorkbenchInstaller.AppImage",
        "GTK_MODULES": "gail:atk-bridge",
        "SHELL": "/bin/bash",
        "XDG_SEAT_PATH": "/org/freedesktop/DisplayManager/Seat0",
        "XDG_CURRENT_DESKTOP": "X-Cinnamon",
        "GPG_AGENT_INFO": "/run/user/1000/gnupg/S.gpg-agent:0:1",
        "GIO_LAUNCHED_DESKTOP_FILE": "/usr/share/applications/nemo.desktop",
        "XDG_SEAT": "seat0",
        "SHLVL": "1",
        "LANGUAGE": "en_US",
        "GDMSESSION": "cinnamon",
        "APPDIR": "/tmp/.mount_ParticaowWhW",
        "GNOME_DESKTOP_SESSION_ID": "this-is-deprecated",
        "LOGNAME": "nrobinson",
        "DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/1000/bus",
        "XDG_RUNTIME_DIR": "/run/user/1000",
        "XAUTHORITY": "/home/nrobinson/.Xauthority",
        "XDG_SESSION_PATH": "/org/freedesktop/DisplayManager/Session0",
        "XDG_CONFIG_DIRS": "/etc/xdg/xdg-cinnamon:/etc/xdg",
        "PATH": "/home/nrobinson/Downloads/node_modules/.bin:/home/nrobinson/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/tmp/.mount_ParticaowWhW:/tmp/.mount_ParticaowWhW:/tmp/.mount_ParticaowWhW/usr/sbin:/home/nrobinson/.cargo/bin:/home/nrobinson/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
        "SESSION_MANAGER": "local/nrobinson-Blade:@/tmp/.ICE-unix/1975,unix/nrobinson-Blade:/tmp/.ICE-unix/1975",
        "OWD": "/home/nrobinson/Downloads",
        "_": "/usr/share/code/bin/../code",
        "APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL": "true",
        "VSCODE_CLI": "1",
        "ELECTRON_NO_ATTACH_CONSOLE": "1",
        "VSCODE_IPC_HOOK": "/run/user/1000/vscode-f539e40b-1.38.1-main.sock",
        "VSCODE_NLS_CONFIG": "{\"locale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}",
        "VSCODE_LOGS": "/home/nrobinson/.config/Code/logs/20190914T231616",
        "AMD_ENTRYPOINT": "vs/workbench/services/extensions/node/extensionHostProcess",
        "PIPE_LOGGING": "true",
        "VERBOSE_LOGGING": "true",
        "VSCODE_IPC_HOOK_EXTHOST": "/tmp/vscode-ipc-780dd52e-2873-47e2-9464-1ba79b64f650.sock",
        "VSCODE_HANDLES_UNCAUGHT_ERRORS": "true",
        "VSCODE_LOG_STACK": "false",
        "VSCODE_PREVENT_FOREIGN_INSPECT": "true",
        "ELECTRON_RUN_AS_NODE": "1"
    },
    "versions": {
        "http_parser": "2.8.0",
        "node": "10.11.0",
        "v8": "6.9.427.31-electron.0",
        "uv": "1.23.0",
        "zlib": "1.2.11",
        "ares": "1.14.0",
        "modules": "69",
        "nghttp2": "1.33.0",
        "napi": "3",
        "openssl": "1.1.0",
        "icu": "62.2",
        "unicode": "11.0",
        "cldr": "33.1",
        "tz": "2019a"
    },
    "vscode": {
        "appName": "Visual Studio Code",
        "appRoot": "/usr/share/code/resources/app",
        "machineId": "88a9f12566b2192cd8183699e573289ca15ed76fac54392caddd97a5c14c1dd9",
        "sessionId": "a6d2880d-6a5d-402c-abc1-5a06ef37eadf1568517377412",
        "version": "1.38.1"
    },
    "extensions": [
        {
            "id": "ms-vscode.node-debug",
            "version": "1.38.4"
        },
        {
            "id": "ms-vscode.node-debug2",
            "version": "1.33.0"
        },
        {
            "id": "ms-vscode.references-view",
            "version": "0.0.30"
        },
        {
            "id": "marus25.cortex-debug",
            "version": "0.3.1"
        },
        {
            "id": "ms-vscode.cpptools",
            "version": "0.25.1"
        },
        {
            "id": "particle.particle-vscode-core",
            "version": "1.5.4"
        },
        {
            "id": "particle.particle-vscode-pack",
            "version": "1.5.4"
        },
        {
            "id": "particle.particle-vscode-snippets",
            "version": "1.5.4"
        },
        {
            "id": "particle.particle-vscode-theme",
            "version": "1.5.4"
        },
        {
            "id": "WakaTime.vscode-wakatime",
            "version": "2.2.0"
        }
    ]
}

are you seeing the issue using the latest version of cortex-debug (currently v0.3.1 iirc)?

Yes

chatting w/ @nrobinson2000 over the weekend, it seems the issue he was hitting was a result of having used the CLI to create his project (via particle project create).

projects created this way will need to be imported to work with Workbench - within VSCode, run the Particle: Import Project command and follow the prompts. if you are starting a new project that you aim to work on with Particle Workbench, the best approach is the run the Particle: Create New Project command within VSCode / Workbench as this ensures the required ./.vscode files are created and available :+1:

1 Like

Furthermore, on Linux there seemed to be a runaway openocd process that was already using port 6666.

$ netstat -tulpn | grep 6666
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:6666          0.0.0.0:*               LISTEN      6374/_openocd 

Killing the process and then starting the debugger in the properly created Workbench project worked.

$ kill -9 6374
1 Like

I created my project using “particle project create” in CLI, and I am getting the OpenOCD GDB Server Timeout failure. So I try to import the project I have already made with “Particle: Import Project” and it asks for my Project.Properties file. So I open my Project.Properties file and it says that it failed to import. I get the following error:

" Directory ./lib exists! cannot install libraries.

Error: Directory ./lib exists! cannot install libraries."

Any fix for this?

I think it is pretty silly that I cannot run the debugger in Visual Studio just because I created the project using the “particle project create” command in terminal

I get the following error:
" Directory ./lib exists! cannot install libraries.

this is because at some point you installed libraries locally via particle library copy or authored your own within a ./lib directory. in both cases, we exit with an error in order to avoid potentially overwriting your data.

if your library dependencies are included within your project.properties and / or you have no use for the ./lib directory, you can safely delete it. importing the project within Particle Workbench (via the Particle: Import Project command) will re-install any libraries you have within your project.properties file. library source files need to be available locally in order to facilitate local compilation.

I think it is pretty silly that I cannot run the debugger in Visual Studio just because I created the project using the “particle project create” command in terminal

the CLI's particle project create does not create the ./lib directory - it generates a file layout as follows:

your-project
├── src/
│   └── your-project.ino
├── README.md  
└── project.properties

a newly created project generated via the CLI's particle project create command imports without issue.

I know this topic is a bit old but I’m having the same issue. I did successfully import my project and allow workbench to create the lib folder. What’s strange to me, however, is that this thread indicates that the issue was fixed with workbench 1.5.0 but the latest version of workbench i see on particle’s website is 1.12.2. Is there a different place i need to look to find the version of workbench?

Thank you!

What’s strange to me, however, is that this thread indicates that the issue was fixed with workbench 1.5.0 but the latest version of workbench i see on particle’s website is 1.12.2

v1.12.2 is (as of writing this) the current version. v1.12.2 > v1.5.0 - see Semantic Versioning

Yup. That’s true. My brain read that as 1.50 and not 1.5.0.

So, that’s not the issue. What else could be contributing to this issue? Thank you m_m.

i didn't realize you were hitting an issue, sorry. please start a new thread with the info called out here:

I know this topic is a bit old but I’m having the same issue. I did successfully import my project and allow workbench to create the lib folder.

Should a new thread be created for the same issue?

I’m also having this issue again. On both my Win10 machines, I get the timeout when trying to debug.
was working fine a month or two back…

I am also having the issue with Particle Workbench v1.13. and Cortex v0.3.12.

Downgrading as the OP suggested did not result in the desired outcome of being able to debug locally.

Edit:: Upon further investigation it seems to be a different error. Putting it in here in case others run into this issue in the future. Still working on a solution at this point.

Error: unable to find CMSIS-DAP device

Edit #2:
Here is the full error under Output when trying to start a debug session:

Open On-Chip Debugger 0.10.0+dev-00920-g6ea43726 (2019-07-09-20:03)
Info : auto-selecting first available session transport "swd". To override use 'transport select '.
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: unable to find CMSIS-DAP device

And under the Debug Console:

Please check OUTPUT tab (Adapter Output) for output from /Users/myname/.particle/toolchains/openocd/0.11.2-adhoc6ea4372.0/bin/openocd

Launching server: "/Users/myname/.particle/toolchains/openocd/0.11.2-adhoc6ea4372.0/bin/openocd" "-c" "gdb_port 50000" "-s" "/Users/myname/.particle/toolchains/openocd/0.11.2-adhoc6ea4372.0/share/openocd/scripts" "-f" "interface/cmsis-dap.cfg" "-f" "target/nrf52-particle.cfg"

Another observation is that there is nothing running on ports 6666, 4444, or 50000 (checked with lsof -i :4444, etc

In your project directory, do you have a .vscode directory with a settings.json file in it? Does it have at least this, maybe more:

{
    "files.associations": {
    },
    "cortex-debug.openocdPath": "${command:particle.getDebuggerOpenocdPath}"
}

In particular, if you manually created the project hierarchy and didn’t do a Particle: Import Project, you might not have the cortex-debug.openocdPath defined, which prevents it from being launched and you can get that error.

It’s not the only reason why it won’t launch, but it’s one of them.

2 Likes