platformio / platform-atmelavr

Atmel AVR: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/atmelavr
Apache License 2.0
138 stars 105 forks source link

PIO Unified Debugger for AVR #95

Open ivankravets opened 6 years ago

ivankravets commented 6 years ago

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/

PLorand commented 6 years ago

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.

aster94 commented 5 years ago

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

vindicatorr commented 5 years ago

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

cebas commented 4 years ago

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

jxsl13 commented 4 years ago

Highly requested feature.

koluckirafal commented 3 years ago

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

barrydegraaff commented 3 years ago

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!

N0cynym commented 1 year ago

@ivankravets any updates about debugging AVR?

maxgerhardt commented 1 year ago

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 commented 1 year ago

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.