Debugging 8bit AVR chips with PlatformIO?

Hello,

I’m wondering if there is any debugger which works with PlatformIO that would allow me to do inline debuging with 8bit AVR chips such as attiny85 or atmega328p.
The official debugger is atmel ICE, and i was able to find some posts mentioning people managed to upload code to the chips with it with PIO, but no mention of any debugging support.
I really enjoy using inline debugging in PIO with my other chips such as stm32 chips, and I would love to also have this functionality for my 8bit AVR chips. So does PIO support debugging with the Atmel ICE, or perhaps some other hardware, for 8bit AVR chips?

Debugging on RealHW already supported through AVR-Stub (GDB stub implementation running on target microcontroller, data exchange via Serial).

No official support and also untested by me. Issue PIO Unified Debugger for AVR · Issue #95 · platformio/platform-atmelavr · GitHub has been open for an eternity, but a light of hope shines as GitHub - avrdudes/avarice: AVaRICE is a program for interfacing the Atmel JTAG ICE to GDB to allow users to debug their embedded AVR target. sees activity again. Per docs it does support

attiny85 (o) (+)
o - Only supported by the JTAG ICE mkII and AVR Dragon device.
+ - debugWire, see below

So if you can get it to work on the commandline with avarice and avr-gdb, it is integretable into PlatformIO via debug_tool options.

1 Like

If i understand it correctly, avr-stub is kind of a simulated debugger, where it inserts code into the sketch to make fake breakpoints, so if the flash is full of regular code it won’t really work, plus it also uses up the serial port and interrupt, those are some big tradeoffs, specially since I often use serial and interrupts in my projects
So it looks like atmel is at fault here for not providing a debugger server?
Oh well, I suppose i’ll just stick with debugging via serial print, it’s not that bad of a method. Thanks.