Debugging Atmel AVR: Failed to launch GDB pioinit 13


I was trying to debug but this error pops up.
Any idea what is wrong ?
Thanks.

What is the platformio.ini and your intended debug method (simavr or avr-stub)?

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino
lib_deps = 
	adafruit/Adafruit GFX Library@^1.10.14
	prenticedavid/MCUFRIEND_kbv@^3.0.0-Beta
	adafruit/Adafruit BusIO@^1.11.3
	adafruit/Adafruit TouchScreen@^1.1.3
	stevemarple/AsyncDelay@^1.1.2
	impulseadventure/GUIslice@0.16.0
	greiman/SdFat@1.1.4

I am trying to use avr-stub.

I don’t see necessary code in your project to initialize avr-stub or even include the library.

Please reproduce the minimal setup at How to debug on Arduino mega 2560 - #2 by maxgerhardt first. (with board being left at your target megaatmega2560 of course, and as documented in https://docs.platformio.org/en/latest/plus/debug-tools/avr-stub.html#debugging-tool-avr-stub).

1 Like

Pardon me, I thought it was a one click thing. Thank you for pointing that out.