I suggest testing the debugger in a simple new project so that you can prove your config and it is also worth reading more on the avr-debugging library git page. The git page for the library might also be the best place for questions to the author.
https://github.com/jdolinay/avr_debug #include <avr8-stub.h>
void setup(void)
{
debug_init(); // initialize the debugger
pinMode(13, OUTPUT);
}
void loop(void)
{
breakpoint(); // stop execution here
digitalWrite(13, HIGH);
delay(200);
digitalWrite(13, LOW);
delay(500);
}
I found some useful test on google about the limitations and also some suggestions. No idea if still current.
The Arduino Serial class cannot be used in your program together with the debugger. The debugger uses the serial line to communicate with the eclipse IDE. This may look like a big problem if you write your programs "the Arduino way", that is, print debug messages to serial line. But when you debug with a debugger you usually do not need to print such messages. If you do need it, there is a function debug_message which can be used to send mesages to debug console in eclipse. If you need to send data from your program (for normal operation, not for debugging), then you have to first debug the program without the serial output and then enable the serial output and disable the debugger. Or you can use the SoftwareSerial on Arduino Uno and on Arduino Mega also the other hardware serial interfaces Serial1, 2, etc.
One of the pins with external interrupt function (INT0, INT1,…) must be reserved for the debugger. With Arduino Uno this can be either digital pin 2 or 3 (PD2 or PD3 pin of the MCU). For Arduino Mega there are more options. By default, INT0 pin (Uno pin 2, Mega pin 21) is used, but you can change this by AVR8_SWINT_SOURCE constant in avr8-stub.h file.
As described above, in the default configuration with RAM breakpoints, the program executes at much lower speed when breakpoints are set in the program. This is because the breakpoints are implemented using a little strange feature of the Atmel AVR architecture - there is always one instruction executed after return from interrupt service routine (ISR) before the same or other ISR can be entered again. Thanks to this feature it is possible to single step the program and compare current program counter with desired breakpoint addresses. But having an interrupt triggered after each instruction does slow down the program a lot. This slowness is not a problem in many cases but if you do find it limiting, you can switch to flash breakpoints.
When using flash breakpoints the watchdog cannot be used. Arduino library does not use watchdog so this is usually not a problem. If you need to use watchdog in your application, enable the code which works with the watchdog only after the application is debugged, or use the RAM breakpoints configuration.