Skip to content

Commit

Permalink
Add a fixed delay for AVR Dragon and Arduino Nano Every on port close
Browse files Browse the repository at this point in the history
  • Loading branch information
MCUdude committed Jan 29, 2024
1 parent 68dd7db commit 129aba5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/avrdude.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -2965,9 +2965,11 @@ programmer # c2n232i

# JTAG2UPDI
# https://github.com/ElTangas/jtag2updi
# Arduino Nano Every (jtag2updi with 1200 baud touch, -r)
# https://github.com/arduino/ArduinoCore-megaavr/tree/master/firmwares/MuxTO

programmer # jtag2updi
id = "jtag2updi";
id = "jtag2updi", "nanoevery";
desc = "JTAGv2 to UPDI bridge";
type = "jtagmkii_updi";
prog_modes = PM_UPDI;
Expand Down
9 changes: 9 additions & 0 deletions src/jtagmkII.c
Original file line number Diff line number Diff line change
Expand Up @@ -1797,6 +1797,15 @@ void jtagmkII_close(PROGRAMMER * pgm)

serial_close(&pgm->fd);
pgm->fd.ifd = -1;

/* The AVR Dragon and the Arduino Nano Every needs a delay
* after a programming session has ended before Avrdude can
* communicate with the programmer again.
*/
if (str_casestarts(pgmid, "dragon"))
sleep(1.5);
else if (str_caseeq(pgmid, "nanoevery"))
sleep(0.5);
}

static int jtagmkII_page_erase(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
Expand Down

0 comments on commit 129aba5

Please sign in to comment.