Debugging AVR / Arduino with ATMELICE / JTAGICE3 and avarice / avr-gdb

Sysprogs forums Forums VisualGDB Debugging AVR / Arduino with ATMELICE / JTAGICE3 and avarice / avr-gdb

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #29664


    I am searching a toolchain for developing software for Arduino (AVR) because the Arudino IDE is so limited. Currently my focus is on VisualGDB.

    My available debug probes are Atmel JTAG 3 and a Atmel ICE which I want use with Debug Wire. And I successful tested them with Microchip Studio.

    Why I don’t want to use Microchip Studio? It is unstable and it doesn’t support unit tests.


    My first attempt was to setup these probes directly. But under the debug settings in Visual GDB “Debug using: JTAG (via AVaRICE)” only offers AVR Dragon, JTAG ICE mkI / II which are very old probes and not available anymore. With this approach I was not able to setup a debug session. At this point I dont’t understand why there are no options for JTAG 3 and ATMEL ICE available, because AVaRICE would support them. See next attempt.

    My second attempt was to use GDB, in particularly avr-gdb. I build version 9.2 for Linux and Windows. I also build the the latest AVaRICE (2.14) for Linux (I have a problem to build them for Windows – termio.h…). My setup looks like this: Windows with avr-gdb <-Ethernet-> Raspberry PI with AVaRICE <-USB-> ATMELICE / JTAG3. I made a test only on terminal level and I was able to establish a debug session. But I am not able to configure VisualGDB to have a full toolchain. 🙁

    Following steps I tried under “Debug settings”:

    Using “Debug using: Full-custom mode”. With the pre-filled “Command” -> “C:\Users\Test\Documents\ArduinoData\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\bin\\avr-gdb”. -> Doesn’t work.

    Here I don’t understand the path, because the path is not valid. Because 1. look at \\ and 2. when go to this directory avr-gdb is not available. I also tried to change that command to the avr-gdb which I build. But every time I click on “Apply” the path is reverted to the original one.


    Using “Debug using Custom GDB Stub”. Here I was able to select the avr-gdb which I build for windows. But when I started a debug session I got a error pop-up. With in the pop-up under the tab “GDB Session” I can again not find the choosen avr-gdb. Again it was the C:\Users\Test\Documents\ArduinoData\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\bin\\avr-gdb.

    Now I have no idea to setup up this, because I can’t find a documentation on your web site. Do you have tips for setup them? Is it possible at all?


    Thanks in advance



    As the AVR devices are much less popular than ARM-based devices, and rely on a relatively unreliable open-source tool (AVaRICE), our support for them is very limited.

    You can find detailed instructions for debugging AVR-based Arduino projects here, however many advanced functionality, such as unit tests will not work.

    The missing avr-gdb error happens because the Arduino core for AVR does not include gdb. VisualGDB can automatically work around it when using our built-in AVaRICE wrapper, but won’t do it for custom setups. The easiest work around would be to copy avr-gdb from either our AVR toolchain or your build of gdb to the directory shown in the error message. Another option would be to override the path to gdb executable via VisualGDB Project Properties -> Embedded Debug Tweaking.


    I am not one to resurrect old threads, but this felt like the most appropriate place.

    This newer repo is where active development occurs for avarice. They even have support for JTAGICE3 which is much more easily acquired.

    They don’t release pre-built windows executables but they can be built with msys. It would be great if visualgdb packaged this version of avarice instead of the stagnant avrdude repo version.



    I am realizing that using something like msys might be too complicated for deployment.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.