WorkBench - trying getting Particle debugger to work

I have the Particle JTAG debugger (v1.0 and numbers 24 18 silk screened on the back of it). I've updated its firmware to v2542. That worked as stated in the online instructions. I'm trying to get a debug session going:

  1. I compiled the Tinker app and OS for debug (6.2.1) locally.
  2. I connected the Particle debugger to USB, the JTAG harness from it to the Argon, and a separate USB cable for the Argon to the PC.
  3. I flashed the App and OS for debug - the Argon flashed successfully.
  4. The Argon then booted up and connected to my WiFi network and is running
  5. I selected the Particle Debugger on WorkBench.
  6. I added a breakpoint to setup()
  7. I launched the debugger on Workbench

The debug icon quickly shows running and then goes away. Nothing is happening. Argo just continues to run as normal. What am I missing? (My WorkBench screen doesn't look like the one's I see in online examples with green run debug button etc.).

The following shows the DEBUG CONSOLE output:

Cortex-Debug: VSCode debugger extension version 1.12.1 git(652d042). Usage info: https://github.com/Marus/cortex-debug#usage
"configuration": {
    "type": "cortex-debug",
    "request": "attach",
    "servertype": "openocd",
    "name": "Particle Debugger",
    "cwd": "/home/terje/Projects/Tinker",
    "rtos": "FreeRTOS",
    "showDevDebugOutput": "raw",
    "armToolchainPath": "/home/terje/.particle/toolchains/gcc-arm/10.2.1/bin",
    "executable": "/home/terje/Projects/Tinker/target/4.2.0/argon/Tinker.elf",
    "serverpath": "/home/terje/.particle/toolchains/openocd/0.12.0-particle.2/bin/openocd",
    "searchDir": [
        "/home/terje/.particle/toolchains/openocd/0.12.0-particle.2/share/openocd/scripts"
    ],
    "configFiles": [
        "interface/cmsis-dap.cfg",
        "target/nrf52-particle.cfg"
    ],
    "postAttachCommands": [
        "add-symbol-file /home/terje/.particle/toolchains/deviceOS/4.2.0/build/target/system-part1/platform-12-m/system-part1.elf"
    ],
    "particle": {
        "version": "1.1.0",
        "debugger": "particle-debugger"
    },
    "__configurationTarget": 6,
    "gdbServerConsolePort": 55878,
    "pvtAvoidPorts": [],
    "chainedConfigurations": {
        "enabled": false
    },
    "debuggerArgs": [],
    "swoConfig": {
        "enabled": false,
        "decoders": [],
        "cpuFrequency": 0,
        "swoFrequency": 0,
        "source": "probe"
    },
    "rttConfig": {
        "enabled": false,
        "decoders": []
    },
    "graphConfig": [],
    "preLaunchCommands": [],
    "postLaunchCommands": [],
    "preAttachCommands": [],
    "preRestartCommands": [],
    "postRestartCommands": [],
    "preResetCommands": [],
    "postResetCommands": [],
    "toolchainPath": "/home/terje/.particle/toolchains/gcc-arm/10.2.1/bin",
    "toolchainPrefix": "arm-none-eabi",
    "extensionPath": "/home/terje/.vscode/extensions/marus25.cortex-debug-1.12.1",
    "registerUseNaturalFormat": true,
    "variableUseNaturalFormat": true,
    "interface": "swd",
    "svdFile": "/home/terje/.particle/toolchains/openocd/0.12.0-particle.2/share/openocd/contrib/svd/nrf52840.svd",
    "device": "nRF52840_xxAA",Cortex-Debug: VSCode debugger extension version 1.12.1 git(652d042). Usage info: https://github.com/Marus/cortex-debug#usage
"configuration": {
    "type": "cortex-debug",
    "request": "attach",
    "servertype": "openocd",
    "name": "Particle Debugger",
    "cwd": "/home/terje/Projects/Tinker",
    "rtos": "FreeRTOS",
    "showDevDebugOutput": "raw",
    "armToolchainPath": "/home/terje/.particle/toolchains/gcc-arm/10.2.1/bin",
    "executable": "/home/terje/Projects/Tinker/target/4.2.0/argon/Tinker.elf",
    "serverpath": "/home/terje/.particle/toolchains/openocd/0.12.0-particle.2/bin/openocd",
    "searchDir": [
        "/home/terje/.particle/toolchains/openocd/0.12.0-particle.2/share/openocd/scripts"
    ],
    "configFiles": [
        "interface/cmsis-dap.cfg",
        "target/nrf52-particle.cfg"
    ],
    "postAttachCommands": [
        "add-symbol-file /home/terje/.particle/toolchains/deviceOS/4.2.0/build/target/system-part1/platform-12-m/system-part1.elf"
    ],
    "particle": {
        "version": "1.1.0",
        "debugger": "particle-debugger"
    },
    "__configurationTarget": 6,
    "gdbServerConsolePort": 55878,
    "pvtAvoidPorts": [],
    "chainedConfigurations": {
        "enabled": false
    },
    "debuggerArgs": [],
    "swoConfig": {
        "enabled": false,
        "decoders": [],
        "cpuFrequency": 0,
        "swoFrequency": 0,
        "source": "probe"
    },
    "rttConfig": {
        "enabled": false,
        "decoders": []
    },
    "graphConfig": [],
    "preLaunchCommands": [],
    "postLaunchCommands": [],
    "preAttachCommands": [],
    "preRestartCommands": [],
    "postRestartCommands": [],
    "preResetCommands": [],
    "postResetCommands": [],
    "toolchainPath": "/home/terje/.particle/toolchains/gcc-arm/10.2.1/bin",
    "toolchainPrefix": "arm-none-eabi",
    "extensionPath": "/home/terje/.vscode/extensions/marus25.cortex-debug-1.12.1",
    "registerUseNaturalFormat": true,
    "variableUseNaturalFormat": true,
    "interface": "swd",
    "svdFile": "/home/terje/.particle/toolchains/openocd/0.12.0-particle.2/share/openocd/contrib/svd/nrf52840.svd",
    "device": "nRF52840_xxAA",
    "pvtVersion": "1.12.1",
    "__sessionId": "a2a1722c-9c00-48f7-9137-e8dd31a222c5",
    "pvtShowDevDebugOutput": "raw"
}
Reading symbols from /home/terje/.particle/toolchains/gcc-arm/10.2.1/bin/arm-none-eabi-objdump --syms -C -h -w /home/terje/Projects/Tinker/target/4.2.0/argon/Tinker.elf
Reading symbols from /home/terje/.particle/toolchains/gcc-arm/10.2.1/bin/arm-none-eabi-nm --defined-only -S -l -C -p /home/terje/Projects/Tinker/target/4.2.0/argon/Tinker.elf
Launching GDB: /home/terje/.particle/toolchains/gcc-arm/10.2.1/bin/arm-none-eabi-gdb -q --interpreter=mi2
1-gdb-version

    "pvtVersion": "1.12.1",
    "__sessionId": "a2a1722c-9c00-48f7-9137-e8dd31a222c5",
    "pvtShowDevDebugOutput": "raw"
}
Reading symbols from /home/terje/.particle/toolchains/gcc-arm/10.2.1/bin/arm-none-eabi-objdump --syms -C -h -w /home/terje/Projects/Tinker/target/4.2.0/argon/Tinker.elf
Reading symbols from /home/terje/.particle/toolchains/gcc-arm/10.2.1/bin/arm-none-eabi-nm --defined-only -S -l -C -p /home/terje/Projects/Tinker/target/4.2.0/argon/Tinker.elf
Launching GDB: /home/terje/.particle/toolchains/gcc-arm/10.2.1/bin/arm-none-eabi-gdb -q --interpreter=mi2
1-gdb-version

UPDATE:

The above problem happens when using Ubuntu 24.10 (oracular).
I switched same PC to Windows, installed WorkBench and debugging worked like a charm.

Under Windows the Particle debugger shows a DAPLINK USB Drive, as does Ubuntu.

Additionally, Windows Device Manager shows a WebUSB CMSIS-DAP port.

I'm guessing my Ubuntu installation does not have this driver loaded.

Does anyone suggestions on how to check and ultimately repair?

Have you installed the udev rule? Without it the debugger may not run properly because it can't access the USB device as non-root. The udev rule enables non-root access to the debugger.

https://docs.particle.io/tools/device-restore/device-restore-jtag/
I tried the JTAG device restore web page on the Particle docs. It worked great.
So driver Particle debugger works under my Ubuntu system. Will try your suggestion next.

If you get a permission error when debugging, you may need to add udev rules.
If you have the Particle Workbench, run the Particle: Launch CLI command and then run particle usb configure in the terminal that launches
if you just have the Particle CLI, open a terminal and run particle usb configure
Otherwise, you can download 50-particle.rules and copy it to /etc/udev/rules.d/

Hi Rick,

I ran the CLI particle usb configure. It said it was already configured. So I copied the 50-particle.rules file to the /etc/udev/rules.d/ directory. Unplugged and re-plugged both the Argon and debugger. Tried debugging - no joy. Rebooted PC and tried - still not working.

I think you're onto something - this feels security related. Although the DEBUG CONSOLE says nothing of it.

It's a good sign that the Particle webpage JTAG restore worked though. I was contemplating buying a SEEGER JLINK device. But not now though.

Any other suggestions?

I also uninstalled every extension from VS and re-installed WorkBench. Same thing.

Reading the Cortex extension installation documentation under VS this line seems relevant:

NOTE: Some linux versions and Windows may also need a more up-to-date version of OpenOCD from the xPack releases.
$ sudo apt-get remove openocd
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package openocd

I tried uninstalling OpenOCD but it did the above. Maybe somehow my OpenOCD install is corrupt/bad. I tried installing:

sudo apt-get install openocd
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package openocd

Hmm. Maybe I need a cleaning. Will investigate.

I fixed the openocd package issue using this:
https://askubuntu.com/questions/378558/unable-to-locate-package-while-trying-to-install-packages-with-apt
Removed and reinstalled it. Tried debug - not working.
Next, I did a full uninstall of Visual Studio and a clean install of it and WorkBench.

Same thing....

I'm thinking now it may be related to Ubuntu 24.10. Not relishing the thought of downgrading. Think I'll just use Windows when low-level debugging is needed.
(related: Ubuntu v24 broke dual-booting awhile back. I waited it out, they eventually fixed it. Think I'll just wait for a fix for this... Happy at least that my now hard-to-get Particle debugger works).

Rick, I really do appreciate your assistance given in this matter. Thanks for trying :+1:

Question: does the Particle WorkBench extension (or some other way) come its own version of OpenOCD for Linux?

Yes, it should be in ~/.particle/toolchains/openocd. It's probably version 0.12.0-particle-d8e1d63 0.12.0-particle.2 in that directory.

Thanks Rick - it's there. I'm still trying some things. The last line in the DEBUG CONSOLE of Code when launch.json is run is when the gdb executable is run. I tried opening a terminal and ran it manually from the that directory.

./.particle/toolchains/gcc-arm/10.2.1/bin/arm-none-eabi-gdb
./.particle/toolchains/gcc-arm/10.2.1/bin/arm-none-eabi-gdb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

Any chance that's an issue?

Yes, that might be it.

  • On 64-bit Linux you may need to install 32-bit libraries:
sudo apt-get install gcc-multilib libarchive-zip-perl libncurses-dev

https://docs.particle.io/getting-started/developer-tools/workbench-faq/#linux-tips

Reading symbols from /home/terje/.particle/toolchains/gcc-arm/10.2.1/bin/arm-none-eabi-objdump --syms -C -h -w /home/terje/Projects/ManseLitesUDP/target/6.2.1/argon/ManseLitesUDP.elf
Reading symbols from /home/terje/.particle/toolchains/gcc-arm/10.2.1/bin/arm-none-eabi-nm --defined-only -S -l -C -p /home/terje/Projects/ManseLitesUDP/target/6.2.1/argon/ManseLitesUDP.elf
Launching GDB: /home/terje/.particle/toolchains/gcc-arm/10.2.1/bin/arm-none-eabi-gdb -q --interpreter=mi2
1-gdb-version

Rick,
I ran your suggested install command. All libs installed well. Still debugger just runs for a second. Rebooted PC. Same.

In a terminal I manually ran each of the programs in as shown in the DEBUG CONSOLE listing:
arm-none-eabi-objdump
arm-none-eabi-nm
arm-non-eabi-gdb

The two first worked great. The gdb one still complains about not finding libncurses.so.5

I ran from root directory:

sudo find . -name libncurses.so.5

None found. (I did notice your install suggestion installs libncurses-dev files...)

Will do more research.

Finally.. It works. I needed libncurses.so.5 installed manually on my 64-bit Ubuntu 24.10 system. Found how to here:

https://askubuntu.com/questions/1531398/how-to-install-libncurses-so-5-for-ubuntu-24-04

I followed this persons advice to edit the etc/apt/sources.list.d/ubuntu.sources file.

What i did on my Ubuntu 24 Install :-

get into /etc/apt/sources.list.d and locate ubuntu.sources.
open the terminal in that directory by right clicking in it.
then run sudo pluma ./ubuntu.sources a pluma editor will open.
just add these lines:-
Types: deb
URIs: http://security.ubuntu.com/ubuntu 
Suites: focal-security
Components: main universe
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
save it and close it.
then in terminal run sudo apt update.
then run sudo apt install libncurses5.
Hopefully that works for you it did for me.
3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.