Have not been able to debug

I purchased the PIO debug capability about a month ago and have yet to get it to work.
I have Visual Code/PlatformIO running on Windows 7, and a project that compiles and runs using the STM32F446 board.
I open the debug window, set a break point in the source code window, and press the green arrow and it seems to compile the code and look like its working for a bit until I get an error that says:

Failed to launch GDB: .pioinit:10: Error in sourced command file:
Remote communication error. Target disconnected.: Success. (from interpeter-exec console
“source .pioinit”)

I can then either cancel or “Open launch.json”. If I open the json file I see this:

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

// PIO Unified Debugger
//
// Documentation: Redirecting...
// Configuration: Redirecting...

{
“version”: “0.2.0”,
“configurations”: [
{
“type”: “platformio-debug”,
“request”: “launch”,
“name”: “PIO Debug”,
“executable”: “c:/Users/Roger-Development/Documents/PlatformIO/Projects/Battery Management System/.pioenvs/nucleo_f446re/firmware.elf”,
“toolchainBinDir”: “C:/Users/Roger-Development/.platformio/packages/toolchain-gccarmnoneeabi/bin”,
“svdPath”: “C:/Users/Roger-Development/.platformio/platforms/ststm32/misc/svd/STM32F446x.svd”,
“preLaunchTask”: {
“type”: “PlatformIO”,
“task”: “Pre-Debug”
},
“internalConsoleOptions”: “openOnSessionStart”
},
{
“type”: “platformio-debug”,
“request”: “launch”,
“name”: “PIO Debug (skip Pre-Debug)”,
“executable”: “c:/Users/Roger-Development/Documents/PlatformIO/Projects/Battery Management System/.pioenvs/nucleo_f446re/firmware.elf”,
“toolchainBinDir”: “C:/Users/Roger-Development/.platformio/packages/toolchain-gccarmnoneeabi/bin”,
“svdPath”: “C:/Users/Roger-Development/.platformio/platforms/ststm32/misc/svd/STM32F446x.svd”,
“internalConsoleOptions”: “openOnSessionStart”
}
]
}

I have absolutely no clue what to do from here. I have searched for others with the same problem but have not found anyone. It’s probably something simple but I’m not an expert in this environment. Most of the online help is just a drink from a firehose instead of simple things to look for.

Roger

1 Like

I have met the same error.
In my point, I use a self designed board, the mcu type have minor difference than official board. I use neucleo-030r8 board config, but actually f030k6t6 installed.
I use board redefine clause in platformio.ini to redefine the mcu type, but actually it does not work, so I got the error as you mentioned.
Then I defined a new board config file with modified from f030r8.json, and now it can be flashed, errors gone.
But now, my question is it seems not works, the led not blinking when running blinky demo.

I completely uninstalled PlatformIO, Visual Code and the project. Then I reinstalled the tools and created a new project (STM32F446RE with mbed framework) with only default code and set a breakpoint. Then I logged into my platformio professional pro account and selected debug. It compiled the simple program and gave me the same same error again. I can’t reduce the problem any smaller than that and it still happens.
My debug console reads:

Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v29 API v2 SWIM v18 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.267240
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting ‘gdb’ connection from pipe
Info : device id = 0x10006421
Info : flash size = 656kbytes
Altonsrean unusual way.
Please contact the application’s support team for more information.
.pioinit:10: Error in sourced command file:
Remote communication error. Target disconnected.: Success.

I wish I knew what the word “Altonsrean” means. I also wish I knew who the application support team is the I am supposed to contact.

Sorry for delay. Does classic “uploading” via ST-Link work?

It’s been a while but do you remember anything that worked or did you give up? Everything I’ve tried to do in PIO has been like this thread.