PIO Unified Debugger

I am receiving the following error when trying to use the Platform IO debugger. This previously worked a few months ago.

I am using the Sodaq Explorer board with Arduino framework.

Reading symbols from e:\Users\Brendan\My Documents\GitHub\FallDetection_V2.pioenvs\sodaq_one\firmware.elf…
done.
PlatformIO Unified Debugger > Redirecting...
PlatformIO: Initializing remote target…
GNU MCU Eclipse 32-bits Open On-Chip Debugger 0.10.0+dev-00392-gbe9ef0b0 (2018-01-12-10:20)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
little
Info : auto-selecting first available session transport “swd”. To override use ‘transport select ’.
none separate
adapter speed: 400 kHz
cortex_m reset_config sysresetreq
Info : tcl server disabled

Any Ideas how I can fix this? I would really appreciate some help.

I have tried on both linux and windows PCs with fresh installs of visual studio code and Platformio.
the launch.json file is below:

// AUTOMATICALLY GENERATED FILE. PLEASE DO NOT MODIFY IT MANUALLY

// PIO Unified Debugger
//
// Documentation: http://docs.platformio.org/page/plus/debugging.html
// Configuration: http://docs.platformio.org/page/projectconf/section_env_debug.html

    {
    "version": "0.2.0",
    "configurations": [
        {
            "type": "platformio-debug",
            "request": "launch",
            "name": "PlatformIO Debugger",
            "executable": "e:/Users/Brendan/My Documents/GitHub/FallDetection_V2/.pioenvs/sodaq_one/firmware.elf",
            "toolchainBinDir": "C:/Users/Brendan/AppData/Roaming/SPB_Data/.platformio/packages/toolchain-gccarmnoneeabi@1.40804.0/bin",
            "svdPath": "C:/Users/Brendan/AppData/Roaming/SPB_Data/.platformio/platforms/atmelsam/misc/svd/ATSAMD21G18A.svd",
            "preLaunchTask": "PlatformIO: Pre-Debug",
            "internalConsoleOptions": "openOnSessionStart"
        },
        {
            "type": "platformio-debug",
            "request": "launch",
            "name": "PlatformIO Debugger (Skip Pre-Debug)",
            "executable": "e:/Users/Brendan/My Documents/GitHub/FallDetection_V2/.pioenvs/sodaq_one/firmware.elf",
            "toolchainBinDir": "C:/Users/Brendan/AppData/Roaming/SPB_Data/.platformio/packages/toolchain-gccarmnoneeabi@1.40804.0/bin",
            "svdPath": "C:/Users/Brendan/AppData/Roaming/SPB_Data/.platformio/platforms/atmelsam/misc/svd/ATSAMD21G18A.svd",
            "internalConsoleOptions": "openOnSessionStart"
        }
    ]
}

Which debugger probe do you use?

i was using a JTAG EDU, but now I am using a Atmel SAM ICE. Neither are working.

The error message from the SAM ICE is:

For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
little
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
none separate
adapter speed: 400 kHz
cortex_m reset_config sysresetreq
Info : tcl server disabled
Info : telnet server disabled
Error: unable to open CMSIS-DAP device 0x3eb:0x2141
.pioinit:12: Error in sourced command file:
Remote communication error.  Target disconnected.: No error.

I am using a Sodaq ONE board.

What is your OS? Do you see debug probe in the list of USB devices?

Is it possible to add selection of display method for watched expressions?
It’s really nearly useless to see a decimal value of an MCU register. I’d love to be able to see it in hex without using an external calculator/converter. Being able to divide any watched value into binary groups would be even greater. But at least please add hex!

This is a problem os VSCode. We don’t have API for this functionality :frowning: See

Nevertheless, could you try

you can use postfixes in Watch window to show numbers in hex format, for example:
Variable,h - show value of Variable in hex
Variable,o - show value as base 8 number

Does it work for you?

I faced the same issue when I use openocd and gdb in VSCode with platformio plugin, but I found it is really slow, I waited about 1 minute to see it enter to first breakpoint, and when I tried to step it, 30 seconds wait is needed. And then I switched to eclipse ide, but I can smoothly debug it. I am using the same toolchain and openocd, what can be related to this issue?

What is your platformio.ini?

Hi, I directly use ftdi as debug tool, and I created platform support for our internal platform.

And for the eclipse debug with openocd and gdb, I mean directly use it, not using the platformio init --ide eclipse one.

[platformio]
description =
    A simple "Hello, World!" example to demonstrate printf and build environment.

[env:nuclei-hbird]
platform = nuclei
framework = nuclei-sdk
board = hbird
monitor_speed = 115200

For debugger support, is there any specific treak need to done?

Thanks
Huaqi

Please create a new topic and keep this platformio.ini file. This thread is so long and I’m not sure that it is related to your question. Thanks!

1 Like

Hi all

I’m a fresh new contributor to this community. I’m re-opening a very old topic “how to debug with GDB on ESP8266 with VSC/PIO” with the Unified Debugger and GDBstub. (eg no HW debugger)

After a few research, I made a specific program called gdbpipe to fix the VSC code issue (eg VSC insert a break-point on a ‘main’ function which does not exist on Arduino , leading GDB to exit right away).
See HERE. It allows to have visual debugging with 8266 program on VSC.
Hope it may save time to someone else on the community as he did on my side.

1 Like