ATMEGA1284P Debugging


I am a new user to PlatformIO / VSCode and planning to use it for a first project in Arduino (having done lots of projects previously with the Arduino v1 IDE). I am using the ATMEGA1284P chip and wish to use the debugging capabilities of the chip / platform.

The chip has JTAG capabilities, but I am not sure what I need to interface with it and debug using it. Segger say that their J-Link debugger is not compatible with the 8bit MCU.

The link here - ATmega1284P — PlatformIO latest documentation says “ATmega1284P has on-board debug probe and IS READY for debugging. You don’t need to use/buy external debug probe.” but I don’t understand how that is intended to work?

Help / pointers / info appreciated.

Thanks very much

The table below that shows the compatible tools. You will find that it lists simavr, which is a AVR simulator. Thus one can debug firmwares for that board in a simulator running locally on the computer.

The wording “has on-board debug probe” is indeed… poorly worded, as there is no debug-probe on-board (also it’s not describing a board but just the pure chip).

PlatformIO does not support debugging the real hardware chip, just simulatting it.

Per this doc, it may be possible to use the AVaRICE program with a Atmel ICE debug probe to debug the chip. PlatformIO has however no built-in integration with avarice, but custom configuration commands exists which can make this work in PlatformIO. See for example the successful example of PlatformIO + CLion + avarice + AVR Dragon + ATMega328P here.

Issues for that are open at PIO Unified Debugger for AVR · Issue #95 · platformio/platform-atmelavr · GitHub and Debug probe support for atmel-ice / dragon and atmega328p processor · Issue #53 · platformio/platform-atmelavr · GitHub.

1 Like