I’ve seen this topic come up a couple times on this forum, but have not seen it answered completely.
I am creating a homemade board using the ATmega32u4 and the internal oscillator at 8MHz. Of all the bootloaders out there for the 32U4, they are created for an external oscillator and thus have different fuses set.
I am looking for a hex file & boards.txt which support the internal oscillator.
I am also looking for support on creating this hex myself. I have used the makefile for ‘caterina-LilyPadUSB’. I have had to download LUFA-111009 to use in the make process. However, I am not dependant on USB, it does not need to be supported for this project.
I have also used http://www.engbedded.com/fusecalc/ to help define the fuses. The modifications to the makefile were:
AVRDUDE_WRITE_FUSES = -U efuse:w:0xff:m #ORIGINAL 0xce:m AVRDUDE_WRITE_FUSES += -U hfuse:w:0xd8:m #ORIGINAL 0xd8:m AVRDUDE_WRITE_FUSES += -U lfuse:w:0xc2:m #ORIGINAL 0xff:m
And I have created my own entry for boards.txt to support this.
caterina.name=Caterina Fraser caterina.upload.protocol=avr109 caterina.upload.maximum_size=28672 caterina.upload.speed=9600 caterina.upload.disable_flushing=true caterina.bootloader.low_fuses=0xc2 caterina.bootloader.high_fuses=0xd8 caterina.bootloader.extended_fuses=0xff caterina.bootloader.path=caterina caterina.bootloader.file=Caterina.hex caterina.bootloader.unlock_bits=0x3F caterina.bootloader.lock_bits=0x2F caterina.bootloader.tool=arduino:avrdude caterina.build.mcu=atmega32u4 caterina.build.f_cpu=8000000L caterina.build.vid=0x1B4F caterina.build.pid=0x9207 caterina.build.core=arduino caterina.build.variant=leonardo
However, the error which I get when trying to burn the bootloader (through a Arduino Nano) is:
avrdude: stk500_initialize(): (b) protocol error, expect=0x10, resp=0x01
avrdude: initialization failed, rc=-1
Makefile.txt (21.6 KB)
boards.txt (630 Bytes)