I use my Duemilanove (w/ 328) for general hackery (using a Mac most of the time, but sometimes OpenBSD), so I've never troubled myself with understanding the fuses. Recently I've been messing about with some timing stuff, which led me in a circle through AVRlib and the ATmega data sheet, and a closer look at my current fuses settings.
Somehow my unit has 0x0, 0x0, 0x0 for the lfuse, hfuse and efuse settings. Which the alert reader will realize is pretty different from what boards.txt says it should have.
I have no idea how I did this, since I've never deliberately reset the fuses on this thing. But who knows? Like I said, I didn't really bother to think about this stuff until now.
Anyway, I'm wondering how I can set these back to the Arduino defaults (which include changes to the clock settings that I think I'd prefer.) When I use avrdude to try and unlock and set them, I get communication errors. I can otherwise flash the unit with new programs and so on. It is only when I try to set the fuses that I get these errors.
clvrmnky@thor:~/src/Demo/firmware $ make fuse
avrdude -C /usr/local/CrossPack-AVR/etc/avrdude.conf -p ATMEGA328P -c arduino -P /dev/cu.usb* -b 57600 -v -v -U lfuse:w:0xFF:m -U hfuse:w:0xDA:m -U efuse:w:0x05:m -U lock:w:0x3F:m
avrdude: Version 5.11.1, compiled on Feb 16 2012 at 22:11:20
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "/usr/local/CrossPack-AVR/etc/avrdude.conf"
User configuration file is "/Users/clvrmnky/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/cu.usbserial-A6008d3w
Using Programmer : arduino
Overriding Baud Rate : 57600
AVR Part : ATMEGA328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : Arduino
Description : Arduino
Hardware Version: 2
Firmware Version: 1.16
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: reading input file "0xFF"
avrdude: writing lfuse (1 bytes):
Writing | | 0% 0.00s ***failed;
Writing | ################################################## | 100% 0.13s
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.02s
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0xff != 0x00
avrdude: verification error; content mismatch
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: lfuse changed! Was ff, and is now 0
Would you like this fuse to be changed back? [y/n]
avrdude: safemode: Fuses OK
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
make: *** [fuse] Error 1
clvrmnky@thor:~/src/Demo/firmware $ echo $?
2
It doesn't matter how I answer the question.
My Google-fu tells me that my bootloader is messed up somehow, and I have no problems using this as an opportunity to experiment with the Optiboot bootloader.
So, what is going on here? What am I missing? I'm using the CrossPack AVR tools from a makefile, if that isn't clear from the output above.