Arduino 1.6.12 & 1.6.13 AVRDUDE issues

Arduino 1.6.12 has several AVRDUDE related issues.

It comes packaged with AVRDUDE which in my installation is located at C:\Users\owen\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino6\bin\avrdude.exe . This reports itself as “Version 6.3, compiled on Sep 12 2016 at 17:24:16”.

Also relevant is the avrdude.conf file (C:\Users\owen\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino6\etc\avrdude.conf).

This article relates to failures to program a bootloader, and failures to program the application using the very common USBASP.

There were two obvious problems:

  1. a false warning message about setting SCK rate, and fatal failure to contact the target; and (when that is resolved)
  2. failure to verify efuse=0x05.

It was observed that the ‘production’ AVRDUDE downloaded from http://download.savannah.gnu.org/releases/avrdude/ did not exhibit problem #1, and on further inspection it reported an earlier compile date “Version 6.3, compiled on Feb 17 2016 at 09:25:53”, and considerably different file size… so it appears that the AVRDUDE distributed by Arduino is different to the ‘production’ version, though it reports the same version number.

Problem #2 relates to an error that has been introduced into the avrdude.conf file.

    memory "efuse"
    size = 1;
    min_write_delay = 4500;
    max_write_delay = 4500;
    read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0",
           "x x x x x x x x o o o o o o o o";

    write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0",
              "x x x x x x x x x x x x x i i i";
    ;

Above is part of the entry for a m328 MCU, and you will note that whilst it only writes the three least significant bits to the efuse, it reads back 8 bits which includes 5 bits that are unimplemented, of writing 0x05 will read back as 0xfd and fail verification.

Changing the entry to the following fixes the efuse verification error.

    memory "efuse"
    size = 1;
    min_write_delay = 4500;
    max_write_delay = 4500;
    read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0",
           "x x x x x x x x x x x x x o o o";

    write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0",
              "x x x x x x x x x x x x x i i i";
    ;

Note that this error is in the ‘production’ AVRDUDE distribution, and this error may be repeated for other MCUs (eg m88, m168 and lots of others… this looks like a bad global change making global havoc).

Replacing the distributed avrdude.exe and fixing the m328 entry in its referenced avrdude.conf has solved the problems for me, and as yet no adverse side effects have been encountered.

I did report this issue to the AVRDUDE bug list… but I would not hold my breath waiting for a fix, it appears the maintainer has struck out on his own.

I compared avrdude.conf for 6.3 with 6.1, and undid the changes where more bits are verified than written from the user, the result is here: avrdude.conf-6.3od.

PS: the same problem was apparent in Arduino 1.6.13 (no surprises there), and the same fix appears to work (note directories are a little different than specified above).