platform-atmelavr icon indicating copy to clipboard operation
platform-atmelavr copied to clipboard

PIO Unified Debugger for AVR

Open ivankravets opened this issue 7 years ago • 11 comments

Problems

  1. We would like to add debugging support for AVR but we can't. Sorry 😞
  2. Microchip does not provide GDB debugging server, all their tools are PROPRIETARY.
  3. They hardcoded debugging to their MPBLAB IDE and use custom proprietary and paid toolchain (not GCC).

So, Microchip is not interested in the free and multi-platform debugger for AVR.

You can try to reach them personally and ask about help https://microchipsupport.force.com/s/

ivankravets avatar Jun 04 '18 11:06 ivankravets

Maybe these can be used as a reference: https://www.avrfreaks.net/forum/tutsoftgcc-avr-debugging-using-gdb-and-avr-dragon-under-linux-ubuntu https://github.com/Lahorde/arduino_avr_template_avr_plugin/blob/master/README.md http://dspace.org.nz/?p=593

I don't see why this functionality couldn't be implemented into PlatformIO to simplify the whole process and make it a one-click procedure (as advertised) for debugging AVR.

PLorand avatar Jul 10 '18 06:07 PLorand

hello, have you seen this? https://github.com/dcwbrown/dwire-debug

aster94 avatar Jan 03 '19 17:01 aster94

@aster94 I came across that today and was very hopeful of making use of it... buuuuut I was bummed to find that atmega16 doesn't have the capability to use it, only JTAG. I keep coming across avarice and may look into that more.

vindicatorr avatar Jun 18 '19 05:06 vindicatorr

Hi @ivankravets , I would love to be able to debug on my arduino uno. Is there any progress on this feature? Thanks

cebas avatar Nov 18 '19 18:11 cebas

Highly requested feature.

jxsl13 avatar Apr 06 '20 05:04 jxsl13

It looks like it would be possible to use AVaRICE debugger server to interface GDB with JTAG/ICE debugger. Someone on PlatformIO forums was already trying to use it with mixed results: https://community.platformio.org/t/atmega32-debugging-with-avarice-and-avr-gdb/15960

koluckirafal avatar Oct 07 '20 08:10 koluckirafal

Hello, I would also like to see AVR debugger support in PlatformIO, even though I can debug just fine over the command line.

Attached 2 documents that document how to debug using ONLY open-source software the Atmega 328p and Atmega 2560 using USB AVR JTAGICE MKII-CN:

debugging-atmega328_README.pdf

debugging-atmega2560_README.pdf

If a developer of PlatformIO is interested, I am willing to ship a USB AVR JTAGICE MKII-CN FOR FREE as donation, but only to a developer that can prove (by commits) they are actively involved in the project. Thanks!

barrydegraaff avatar Oct 23 '20 06:10 barrydegraaff

@ivankravets any updates about debugging AVR?

N0cynym avatar Dec 21 '22 15:12 N0cynym

I'm the CI maintainer of the AVaRICE program now, which is supposed to be able to use several debugging probes (Atmel-ICE, AVR Dragon, mEDBG, eDBG, ...) to open a GDB server. After some testing on real hardware (got an ATMega328P XPlained Mini with mEDBG probe on the way) and packaging of binaries I'll then be excited to bring these improvements into PlatformIO for AVR debugging support.

In parallel I've asked Microchip to expand their Python libraries (microchip-pic-avr-tools/pyedbglib) with a possible GDB sever as another posibility here.

maxgerhardt avatar Jan 15 '23 21:01 maxgerhardt

I am making slow but steady progress with AVaRICE on a ATMega328P XPlained Mini (mEDBG) board, incorporating a few patches, recompiling avr-gdb with XML support, and now I got PlatformIO + avarice + avr-gdb to load the firmware binary through debugWire, set a breakpoint and have it stop. Line by line debugging of the chip actually works.

grafik

Excited to test more and make it better.

maxgerhardt avatar Jan 20 '23 01:01 maxgerhardt