Debugger for Arduino uno / Mega and ESP8266

Is it possible or are there any plans to make the debugger usable with the boards mentioned in the title?

Currently, our debugger does not support these boards for debugging. However, we plan to add debugging for AVR soon. Please stay tuned with us on https://twitter.com/PlatformIO_Org

Hi Ivan! Any news of this? Is there a roadmap?

Tkhs,
AgustĂ­n

Are you interested in debugging for AVR or ESP8266?

AVR, specifically: Arduino Uno and Mega.

1 Like

Any updates on progress for debug support for AVR? It’s been more than a year now and It would help my productivity immensely to have inline debugging on my Arduino Mega 2560.

1 Like

@ivankravets Any updates on a PlatformIO debugger implementation for AVR-based Arduino boards (in my case, specifically the Arduino Mega)? Thanks!

1 Like

We would like to have an option with debugging for AVR. Microchip does not have debug server to solve this. They use something proprietary called MDB which is classic GDB. See our discussion here
https://twitter.com/PlatformIO_Org/status/1180562414334550016

1 Like

The question as to debugging Arduino Uno and Mega with PlatformIO was placed a year and a half ago. The response then was soon. This does not seem to have happened. Is there a plan for these chips to be supported soon. I develop with AtmelStudio (1391 - have not tried their latest version 2397) and have not been able to use it to debug a Uno with Atmel ICE. I would shift to developing with PlatformIO if it were able to do this.

Thanks
Michele

I don’t know about the developments of a proper solution with Microchip provided debug tools, maybe @ivankravets can comment here.

However there are parallel developments which use a homebrew dwire-debug GDB server which might prove usable in this thread: VSCode PIO debugger for AVR

Thanks Max. The solution you propose may work but it seems a little complex, I do not have it in me to spend the time and effort to get it to work. The AtmelStudio Atmel ICE combination should work out of the box except that it does not, and there does not seem to be any support on it, the forums teem with programmers who have experienced much frustration trying to get this combo to work. I would trust that if the PlatformIO teem were to release support for 8 bit AVR chips, it should work, and if not, there would be support. That’s why I would like a reply for them as to a possible favorable outcome soon.

Thanks for responding.
Michèle

1 Like

Could you try GitHub - dcwbrown/dwire-debug: Simple stand-alone debugger for AVR DebugWIRE chips connected directly to an FT232R/CH340/DigiSpark/LittleWire on Linux or Windows. with GDB? Does it work?

Ivan, thanks. I’ve alread yindicated my answer to the previous reply that I was looking for a professional tool which worked out of the box; i.e. follow instructions and get results.I don’t want to get into the hassle of discovering GDB. I fear that it might be a hacker’s delight. As mentioned before, the AtmelStudio Atmel ICE combination does not work on an AtMega328P; it could be a bug in the AtmelStudio version I used (1391). I am now using AtmelStudio 2397but have not tested it with Atmel ICE. Perhaps it works. In the meantime, I discovered PlatformIO which has its plusses and minuses over AtmelStudio. A very big plus would be AtMega328P and AtMega2560 debug support.

Thanks again,
Michèle

1 Like

Hi Ivan

Yes I tried it with a remote configuration on a Raspberry pi. Here is my platformio.ini

[env:nanoatmega328]
platform = atmelavr
board = nanoatmega328
framework = arduino
build_type = debug
debug_tool = custom
debug_server = $PLATFORMIO_CORE_DIR\packages\toolchain-atmelavr\bin\avr-gdb.exe
debug_init_cmds =
set remoteaddresssize 32
target remote RASPBERRYPI.local:4444

I am able to upload through dwdebug command on the RPI, then launch a debug session on VSCODE.

However there are some missing features, like software breakpoint, the AVR register debug windows is not filled (no register enumeration… ) and the IO registers are also empty, and finally there are some misinterpretation of Flash and RAM addres (AVR is a Harvard architecture) and no EEPROM window.
On top of that, no upload facility other than manually scp firmware.elf to the rpi and using dxdebug appropriate command.

But it is usable with those heavy limitations using DebugWire only, including for flashing the target.
BTW I used avrdude on the RPI to set the fuses up, PlatformIO refuses to direct avrdude to update fuses accordingly. (I did probably not find the right trick…)

So since times are to confinment, I am exploring technical feasibility to twist dwdebug for adding missing features the gdbserver side, using a simple CH340 either local or remote on a rpi or anything else.
Another track is to fork blackmagic software, but this is more complicated for me.

What I don’t understand is the way to “talk” to a gdb server directly with PIO Unified debugger and add those features. Is there somewhere something to read to understand this? Am I missing something?

Ultimately, I thing adding AVR DWIRE/ISP debugging either through a CH340 or through ATMEL-ICE should be of a real value for many people who want to do better than just blinking leds through Arduino IDE.

What do you think?

2 Likes