PlatformIO Community

Cannot debug STM32: "Failed to launch GDB: Error: write EPIPE"

Hello,

I just started to have error Failed to launch GDB: Error: write EPIPE on debugging start.
err2
I am using PlatformIO IDE plugin for VS Code on Windows 10.
Yesterday and in the morning debugger was working. Then I turned off my laptop, turned it on back again hour later and now I cannot start debugging. Platformio is able to build code and upload on board (STSTM32F4 Discovery if it matters) but launching debugging session is blocked by that error.

  • Tried: removing .pio directory in project root, rebooting my laptop, uninstalling and installing back PlatformIO IDE plugin, running VS Code as admin, removing .platformio dir in home directory to force platformio core reinstall. Nothing changed, still the same problem.

  • To check if this is my application config problem I generated fresh platformio project for the board I am using. Still the same error so problem seems to be on platformio/vscode side.

  • The same error is thrown even if Discovery board is not connected to PC, I think that means problem is before plaformio debugger tries to connect with board

  • On Eclipse with SW4STM32 plugin setup on the same laptop, debugging that Discovery board is working - seems like this is not problem with my laptop OS or hardware.

  • I was able to reproduce problem on another Win10 laptop after fresh installation of VS Code + PlatformIO IDE

  • Tested on disco_f407vg, bluepill_f103c8 boards with the same result

Can someone help, and how can I assist in that?

versions
VS Code, PlatformIO versions

  • In vscode dev console are two errors. Debug start fail, Could not start debugger process > Error: spawn platformio ENOENT is second. First error (node:8584) [DEP0005].
    Error
    It is C/C++ plugin thing (https://github.com/microsoft/vscode-cpptools/issues/4381). It is still there if I uninstall or disable PlatformIO IDE, leave C/C++ plugin active and reload. DEP0005 error disappears when I disable or remove C/C++ plugin.
    Not sure if it has anything to do with my problem.

Can you please check if downgrading the PIO extension makes a difference. On the left sidebar -> Extensions -> PlatformIO -> Cogwheel -> Install other version -> 2.1.0 (2.0.1 also working).

2 Likes

I cannot help but can confirm that I have exactly the same issue. I’m debugging a Wio Terminal (ATSAMD 51P19 MCU). Up to yesterday all worked perfect. Today have the same error messages,

Downgrading the PIO extension to version 2.1.0 fixed the issue for me. Version 2.1.1 did not work. I didn’t even see the PIO Home screen.

1 Like

Yes that version is unstartable due to the bug described in https://github.com/platformio/platformio-vscode-ide/issues/2170, that’s why it was fixed and re-released within one hour, too, as 2.1.2.

Looking at the commit history yesterday I noticed commit

…was removing that PlatformIO calls could be done in a normal terminal. This is a guess in the blue, but maybe it has something to do with the issue of not being able to start the debug server? Or maybe that commit interferes.

This patch is included since 2.1.1, so since extension version 2.1.0 works as reported, it’s a strong indication that that might have something to do with it.

Anyways, since 3 users have confirmed this issue (also see topic Error debugging for NUCLEO-F103RB, Can't debug with esp32), I think @ivankravets should look at this regression.

1 Like

For me on plugin 2.1.0 debugging is working.
2.1.1 - nothing works, PlatformIO Home wont even open, no build, no upload.
2.1.2 - no debugging, but build + upload are working.

Thanks for solution/workaround.

Sorry for the issue, fixed in https://github.com/platformio/platformio-vscode-ide/releases/tag/v2.1.3
Please update the extension.

P.S: @maxgerhardt, big THANK YOU that ping me always in these critical situations! :pray:

1 Like

2.1.3 and debugging is working as it should.
Wow that was quick, thanks.

2 Likes