Programm SAMD21 directly

I remember EPIPE being a problem in some buggy intermediate PlatformIO version (Cannot debug STM32: "Failed to launch GDB: Error: write EPIPE") that was supposedly fixed however.

Are all your VSCode extension versions up-to-date? Upgrading the latest PIO core and platforms (CLIpio upgrade --devpio platform update → VSCode restart) and makes no difference?

Also a sanity check would be good. Open a CLI as linked above, then cd into C:\Users\<user>\.platformio\tool-openocd. Then execute

bin\openocd -s scripts -f interface/cmsis-dap.cfg -c "set CHIPNAME at91samd21e17" -f target/at91samdXX.cfg

Can OpenOCD connect to the target chip?

If yes, Ctrl+C again to abort. You can try to add

; change build type to debug so that uploaded firmware is directly debug firmware
; remove for release
build_type = debug
debug_tool = custom
debug_server =
debug_port = localhost:3333
debug_init_break = tbreak setup

in the platformio.ini, while removing the old debug_tool declaration. Upload once again. Open a new terminal (Windows+R → cmd.exe), cd into the same directory and start openocd again with the command above. Then try and start the PIO debugger again, with either of the tasks.

Do you then see in the OpenOCD window that a GDB client connects at some point?

1 Like