I wanted to reflash my Arduino’s bootloader and I had an ISP programmer handy - easy enough, right? So I connected my Olimex AVR-ISP500 using the 6-pin ISP cable, tweaked the Arduino firmware Makefile to talk with the ISP500 (off topic: I don’t understand why it insists on identifying as a modem).
Everything worked fine to start: it programmed the fuses correctly and then cheerfully proceeded to flash the firmware to the flash. Avrdude rather promptly showed a percentage bar with 83% complete, the ISP500 light was a pleasantly-programming orange, and then the programmer reset itself, causing it to disconnect and reconnect via USB. As this is a Linux system, Avrdude still had /dev/ttyACM0 open and it bound it to /dev/ttyACM1. Avrdude never finished and just hung there.
I tried tweaking some of the settings (-P and -b) in avrdude and was unsuccessful in getting it to program the chip at all; unfortunately, the programer resets every time. I upgraded my AVR-ISP500 to the latest firmware in the off chance that there was some bug in an earlier version - no change.
I eventually found another Arduino and used the Arduino-based AVRISP to program the firmware. This programmer worked just fine.
It sounds like some strange bug in the Olimex programmer or maybe some unhappy interaction with avrdude. Any thoughts on what is going on?
Some versions:
Avrdude 5.10
Arduino 0021 / Duemilanove w/ atmega168
Olimex AVR-ISP500 (fw: 1.0.0.10)
Debian Squeeze/Sid
Output of the programming (verbose output is attached):
avrdude -c stk500v2 -p atmega168 -P /dev/ttyACM0 -b 115200 -e -u -U lock:w:0x3f:m -U efuse:w:0x00:m -U hfuse:w:0xDD:m -U lfuse:w:0xFF:m
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.10s
avrdude: Device signature = 0x1e9406
avrdude: erasing chip
avrdude: reading input file "0x3f"
avrdude: writing lock (1 bytes):
Writing | ################################################## | 100% 0.04s
avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3f:
avrdude: load data lock data from input file 0x3f:
avrdude: input file 0x3f contains 1 bytes
avrdude: reading on-chip lock data:
Reading | ################################################## | 100% 0.03s
avrdude: verifying ...
avrdude: 1 bytes of lock verified
avrdude: reading input file "0x00"
avrdude: writing efuse (1 bytes):
Writing | ################################################## | 100% 0.03s
avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0x00:
avrdude: load data efuse data from input file 0x00:
avrdude: input file 0x00 contains 1 bytes
avrdude: reading on-chip efuse data:
Reading | ################################################## | 100% 0.03s
avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "0xDD"
avrdude: writing hfuse (1 bytes):
Writing | ################################################## | 100% 0.04s
avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xDD:
avrdude: load data hfuse data from input file 0xDD:
avrdude: input file 0xDD contains 1 bytes
avrdude: reading on-chip hfuse data:
Reading | ################################################## | 100% 0.03s
avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xFF"
avrdude: writing lfuse (1 bytes):
Writing | ################################################## | 100% 0.04s
avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xFF:
avrdude: load data lfuse data from input file 0xFF:
avrdude: input file 0xFF contains 1 bytes
avrdude: reading on-chip lfuse data:
Reading | ################################################## | 100% 0.03s
avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude done. Thank you.
avrdude -c stk500v2 -p atmega168 -P /dev/ttyACM0 -b 115200 -U flash:w:ATmegaBOOT_168_diecimila.hex -U lock:w:0x0f:m
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.10s
avrdude: Device signature = 0x1e9406
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "ATmegaBOOT_168_diecimila.hex"
avrdude: input file ATmegaBOOT_168_diecimila.hex auto detected as Intel Hex
avrdude: writing flash (16294 bytes):
Writing | ############################################