So, I have hooked up a ATtiny88, and am programming it with the Dragon AVR using ISP. I have also set up the build toolchain, using avrdude, and the gnu avr tools. Everything is working great.

Now I would like to do in-circuit debugging using the advertised debugwire which is also connected to the ISP and which the dragon supports. But which tools do I use? I see there is a avr-gdb, but it seems that I needs some kind of simulator, however I would like to debug in-circuit on the real MCU. Is this possible?

Thanks in advance.

  • 1
    \$\begingroup\$ I'm also interested in how one actually uses debugwire. I keep seeing it in the manuals for my chips, but haven't had occasion to use it yet. \$\endgroup\$
    – vicatcu
    Commented Jul 26, 2010 at 20:22

2 Answers 2


Have a look at avarice. It's man page also has something to say about debugwire. I don't know if that'll be good news or bad, though.

  • 1
    \$\begingroup\$ You are right, it really seems that avarice does support both the AVR Dragon and debugWire debugging. There is however the drawback, that to enable debugging with the debugWire, the reset pin fuse has to be change do debugWire mode, which means that ISP is no longer possible, leaving only the option of reflashing the device using high voltage programming. :/ \$\endgroup\$
    – bjarkef
    Commented Jul 26, 2010 at 22:40
  • 5
    \$\begingroup\$ There is a workaround for this problem: You can reprogram the fuses using debugWire/avarice. So, after your debug session, just reset the DWEN fuse with avarice and you've got ISP back. \$\endgroup\$
    – markus_b
    Commented Apr 15, 2011 at 17:49

enable debugwire

enable with avrdude (fuse for attiny88):

avrdude -c dragon_isp -P usb -p attiny88 -v -U hfuse:w:0xd9:m


  • must be compiled with -ggdb or great (--gdb3) but doesn't seem to help with macros
  • no optimisations

    COMPILE = $(GCC_PATH) -ggdb3 -Wall -Wextra $(OPTIMIZATION) -std=gnu11 -flto -mmcu=$(DEVICE) -DF_CPU=$(CLOCK)

need main.hex and main.elf


start avarice:

avarice -g -w -P attiny88 :4242

then start gdb:

avr-gdb main.elf

and connect:

target remote localhost:4242


only sw breakpoints with debugwire, so if need breakpoints use:


switch back to spi/icsp mode

NB. VTG/VCC pin (2 on header) must be connected to chip supply for this to work!

avrdude -c dragon_isp -P usb -p attiny88 -v -U hfuse:w:0xdd:m
  • 1
    \$\begingroup\$ This looks spot-on, but please include relevant commands in your answer before the link goes down. \$\endgroup\$ Commented Jun 7, 2017 at 11:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.