From c67d48b6021a03006c8da8fa8c643662563b1050 Mon Sep 17 00:00:00 2001 From: Jon Langseth Date: Sun, 30 Jun 2013 01:12:36 +0200 Subject: [PATCH] CORRECTION * Updated to correctly support bootloader programming w/Optiboot. Removed ERRORS in Makefile setting incorrect fusebits and lockbits. Get Optiboot v4.4 from https://code.google.com/p/optiboot/downloads/list Use Optiboot v4.4, modify target optiboot-target "atmega328" and set AVR_FREQ to atmega328: AVR_FREQ = 20000000L Reccomended to also change the LED pin definitions in pin_defs.h of Optiboot: #define LED_DDR DDRD #define LED_PORT PORTD #define LED_PIN PIND #define LED PIND6 --- Makefile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 2569c38..18de3f6 100644 --- a/Makefile +++ b/Makefile @@ -241,7 +241,7 @@ FUSES = ifdef FUSE_EXT FUSES += -U efuse:w:$(FUSE_EXT):m endif -FUSES += -U efuse:w:$(FUSE_EXT):m +FUSES += -U hfuse:w:$(FUSE_HIGH):m FUSES += -U lfuse:w:$(FUSE_LOW):m fusebits: $(TARGET).hex @@ -251,10 +251,7 @@ lockbits: $(TARGET).hex $(AVRDUDE) -p $(MCU) $(AVRDUDE_PROG) -e -u -U lock:w:$(FUSE_LOCK):m bl_fusebits: $(TARGET).hex - $(AVRDUDE) -p $(MCU) $(AVRDUDE_PROG) -U efuse:w:$(BL_FUSE_EXT):m -U efuse:w:$(BL_FUSE_EXT):m -U lfuse:w:$(BL_FUSE_LOW):m - -bl_lockbits: $(TARGET).hex - $(AVRDUDE)-p $(MCU) $(AVRDUDE_PROG) -e -u -U lock:w:$(BL_FUSE_LOCK):m + $(AVRDUDE) -p $(MCU) $(AVRDUDE_PROG) -U efuse:w:$(BL_FUSE_EXT):m -U hfuse:w:$(BL_FUSE_HIGH):m -U lfuse:w:$(BL_FUSE_LOW):m # Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. COFFCONVERT=$(OBJCOPY) --debugging \ -- 2.39.2