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


I just started to have error Failed to launch GDB: Error: write EPIPE on debugging start.

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?

VS Code, PlatformIO versions

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).


I cannot help but can confirm that I have exactly the same issue. I鈥檓 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鈥檛 even see the PIO Home screen.

1 Like

Yes that version is unstartable due to the bug described in PIO 2.1.1 does not work 路 Issue #2170 路 platformio/platformio-vscode-ide 路 GitHub, that鈥檚 why it was fixed and re-released within one hour, too, as 2.1.2.

Looking at the commit history yesterday I noticed commit

鈥as 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鈥檚 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 Release 2.1.3 路 platformio/platformio-vscode-ide 路 GitHub
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.