avrdude fuse settings for Uno Rev3?

Hello, I am trying to find the fuse settings Arduino has for the Uno Rev 3 (uses the ATMega328p).

I think the command looks something like this (based on verbose mode of the Arduino IDE)
avrdude -c arduino -p m328p -P /dev/cu.usbserial-AD01V737

However, I cannot find what the fuse settings are. I expect to see something of the following form:
-U lfuse:w:0x60:m -U hfuse:w:0xd9:m -U efuse:w:0xff:m

Where can I find this information?

Thanks

The fuse settings are in boards.txt.

CrossRoads:
The fuse settings are in boards.txt.

Thank you - I had forgotten about that file. However, when I used the low, high and extra fuse settings and got the following:

avrdude -c arduino -p m328p -P /dev/cu.usbserial-AD01V737  -U lfuse:w:0xff:m -U hfuse:w:0xde:m -U efuse:w:0x05:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e950f
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 changed! Was ff, and is now 0
Would you like this fuse to be changed back? [y/n]

I'm really confused. Is it really looking for an input file for 0xff based on these lines?

avrdude: load data lfuse data from input file 0xff:
avrdude: input file 0xff contains 1 bytes

for completeness, the boards.txt file has the following entries for the uno board

##############################################################

uno.name=Arduino Uno
uno.upload.protocol=arduino
uno.upload.maximum_size=32256
uno.upload.speed=115200
uno.bootloader.low_fuses=0xff
uno.bootloader.high_fuses=0xde
uno.bootloader.extended_fuses=0x05
uno.bootloader.path=optiboot
uno.bootloader.file=optiboot_atmega328.hex
uno.bootloader.unlock_bits=0x3F
uno.bootloader.lock_bits=0x0F
uno.build.mcu=atmega328p
uno.build.f_cpu=16000000L
uno.build.core=arduino
uno.build.variant=standard

##############################################################

avrdude -c arduino -p m328p -P /dev/cu.usbserial-AD01V737 -U lfuse:w:0xff:m -U hfuse:w:0xde:m -U efuse:w:0x05:m

You won't be able to modify (or even read) the fuses by using the bootloader; you'd need an external programming device (perhaps another Arduino running ArduinoISP.)

westfw:

avrdude -c arduino -p m328p -P /dev/cu.usbserial-AD01V737 -U lfuse:w:0xff:m -U hfuse:w:0xde:m -U efuse:w:0x05:m

You won't be able to modify (or even read) the fuses by using the bootloader; you'd need an external programming device (perhaps another Arduino running ArduinoISP.)

ahhh, thanks. didn't realize that.

However, if I have an Uno Rev3 board with a bootloader already installed, how would I modify my avrdude command to upload a sketch via the command line?

avrdude -c arduino -p m328p -P /dev/cu.usbserial-AD01V737 -U flash:w:myfile.hex

westfw:

avrdude -c arduino -p m328p -P /dev/cu.usbserial-AD01V737 -U flash:w:myfile.hex

hmmm, I must be doing something wrong as I don't see the arduino board do the "blinking led" that the program is commanding it to do.

avr-gcc -Wall -Os -DF_CPU=16000000L -mmcu=atmega8 -c main.c -o main.o
avr-gcc -Wall -Os -DF_CPU=16000000L -mmcu=atmega8 -o main.elf main.o
rm -f main.hex
avr-objcopy -j .text -j .data -O ihex main.elf main.hex
avr-size --format=avr --mcu=atmega328p main.elf
AVR Memory Usage
----------------
Device: atmega328p

Program:     136 bytes (0.4% Full)
(.text + .data + .bootloader)

Data:          0 bytes (0.0% Full)
(.data + .bss + .noinit)

and the result of the flash:

avrdude -c arduino -p atmega328p -P /dev/cu.usbserial-AD01V737  -U flash:w:main.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e950f
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 "main.hex"
avrdude: input file main.hex auto detected as Intel Hex
avrdude: writing flash (136 bytes):

Writing | ################################################## | 100% 0.08s

avrdude: 136 bytes of flash written
avrdude: verifying flash memory against main.hex:
avrdude: load data flash data from input file main.hex:
avrdude: input file main.hex auto detected as Intel Hex
avrdude: input file main.hex contains 136 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.07s

avrdude: verifying ...
avrdude: 136 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

and here is main.c

#include <avr/io.h>
#include <util/delay.h>

int main(void)
{
    DDRD = 1 << 4;           /* make the LED pin an output */
    for(;;){
        char i;
        for(i = 0; i < 10; i++){
            _delay_ms(10);  /* max is 262.14 ms / F_CPU in MHz */
        }
        PORTD ^= 1 << 4;    /* toggle the LED */
    }
    return 0;               /* never reached */
}

If you're trying to blink the pin13 LED, it's on D5, not D4...

I meant B5. Cough.

MMCU = atmega8
DEVICE = atmega328p

That looks like a problem...

westfw:
I meant B5. Cough.

MMCU = atmega8
DEVICE = atmega328p

That looks like a problem...

Great points. I modified the sketch which worked in the Arduino environment but not on the command line. When I used the hex file generated by Arduino, the command line worked. So I think something is screwy with my compilation (or it is that MMCU issue you pointed out). I'm almost there :slight_smile:

IT WORKED with MMCU=atmega328p

Thank you!!!!!!!!!!!!!!! :grin: :smiley: :slight_smile: :stuck_out_tongue: 8)