My arduino had spontaneously stopped working, and after a bit of diagnostics I came to the conclusion that the AVR itself was the cause of the problems. Fortunately I have another device capable of programming the AVR bootloader via ICSP, the Gertboard. After swapping the AVR chips round, I was able to reprogram the bootloader (and reset the fuse values) using the normal arduino UI, and then the chip worked fine once placed back in the Arduino board! I’m still none the wiser as to why the chip became inoperable…
Some commands I found useful along the way:
Write fuse values with:
avrdude -qq -c gpio -p atmega328p -U lock:w:0x3F:m -U efuse:w:0x05:m -U lfuse:w:0xFF:m -U hfuse:w:0xDA:m
Read fuse values with:
avrdude -c gpio -p atmega328p -U lfuse:r:-:h -U hfuse:r:-:h -U efuse:r:-:h
Note that these are using an avrdude customised for the Gertboard available as a debian package from https://projects.drogon.net/raspberry-pi/gertboard/