]> git.defcon.no Git - avrfbosd/commitdiff
CORRECTION * Updated to correctly support bootloader programming w/Optiboot.
authorJon Langseth <jon.langseth@lilug.no>
Sat, 29 Jun 2013 23:12:36 +0000 (01:12 +0200)
committerJon Langseth <jon.langseth@lilug.no>
Sat, 29 Jun 2013 23:12:36 +0000 (01:12 +0200)
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

index 2569c38b2b132abce3a733e780768a9c8ab3883d..18de3f6fa12c5c46f901d0bc039d66a6b1d42f09 100644 (file)
--- 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 \