UNTESTED fuse programming support
This commit is contained in:
parent
eaf8a9dcec
commit
0816cecf1e
10
Makefile
10
Makefile
|
|
@ -122,8 +122,16 @@ program: $(PROGRAM).hex config.h
|
|||
$(AVRDUDE) -cstk500v1 -b$(PROGBAUD) -p$(MCU_TARGET) -P$(PROGPORT) -C$(AVRDUDECONF) -U flash:w:$^
|
||||
stty 115200 raw ignbrk -hup -echo ixoff < $(PROGPORT)
|
||||
|
||||
program-fuses:
|
||||
avr-objdump -s -j .fuse mendel.o | perl -ne '/\s0000\s([0-9a-f]{2})/ && print "$$1\n"' > lfuse
|
||||
avr-objdump -s -j .fuse mendel.o | perl -ne '/\s0000\s..([0-9a-f]{2})/ && print "$$1\n"' > hfuse
|
||||
avr-objdump -s -j .fuse mendel.o | perl -ne '/\s0000\s....([0-9a-f]{2})/ && print "$$1\n"' > efuse
|
||||
$(AVRDUDE) -cstk500v1 -b$(PROGBAUD) -p$(MCU_TARGET) -P$(PROGPORT) -C$(AVRDUDECONF) -U lfuse:w:lfuse
|
||||
$(AVRDUDE) -cstk500v1 -b$(PROGBAUD) -p$(MCU_TARGET) -P$(PROGPORT) -C$(AVRDUDECONF) -U hfuse:w:hfuse
|
||||
$(AVRDUDE) -cstk500v1 -b$(PROGBAUD) -p$(MCU_TARGET) -P$(PROGPORT) -C$(AVRDUDECONF) -U efuse:w:efuse
|
||||
|
||||
clean:
|
||||
rm -rf *.o *.elf *.lst *.map *.sym *.lss *.eep *.srec *.bin *.hex *.al *.i *.s *~
|
||||
rm -rf *.o *.elf *.lst *.map *.sym *.lss *.eep *.srec *.bin *.hex *.al *.i *.s *~ *fuse
|
||||
|
||||
size: $(PROGRAM).elf
|
||||
@echo " SIZE Atmega168 Atmega328p Atmega644"
|
||||
|
|
|
|||
15
README
15
README
|
|
@ -18,10 +18,25 @@ Rewrite of Reprap Mendel firmware:
|
|||
2) check programming settings in Makefile
|
||||
3) make
|
||||
4) make program
|
||||
4a) if programming blank chip, make program-fuses
|
||||
5) ./sender.sh
|
||||
6) have a play, go to 1) if not right
|
||||
7) try printing something!
|
||||
|
||||
##############################################################################
|
||||
# #
|
||||
# Requirements #
|
||||
# #
|
||||
##############################################################################
|
||||
|
||||
Compile:
|
||||
gnu make
|
||||
binutils, gcc, etc built for avr target (avr-gcc, avr-as, etc)
|
||||
avr-libc
|
||||
Program:
|
||||
avrdude
|
||||
something that avrdude supports: bootloader, separate programmer, whatever
|
||||
|
||||
##############################################################################
|
||||
# #
|
||||
# License #
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
#if defined (__AVR_ATmega168__)
|
||||
FUSES = {
|
||||
.low = FUSE_CKSEL3 & FUSE_SUT0,
|
||||
.high = FUSE_SPIEN,
|
||||
.extended = FUSE_BOOTSZ1 & FUSE_BOOTSZ0,
|
||||
};
|
||||
#elif defined (__AVR_ATmega328P__)
|
||||
FUSES = {
|
||||
.low = FUSE_CKSEL3 & FUSE_SUT0,
|
||||
.high = FUSE_SPIEN & FUSE_BOOTSZ0 & FUSE_BOOTSZ1,
|
||||
.extended = EFUSE_DEFAULT,
|
||||
};
|
||||
#elif defined (__AVR_ATmega644__) || defined (__AVR_ATmega644P__)
|
||||
FUSES = {
|
||||
.low = FUSE_CKSEL3 & FUSE_SUT0,
|
||||
.high = FUSE_SPIEN & FUSE_BOOTSZ0 & FUSE_BOOTSZ1,
|
||||
.extended = EFUSE_DEFAULT,
|
||||
};
|
||||
#elif defined (__AVR_ATmega1280__)
|
||||
FUSES = {
|
||||
.low = FUSE_CKSEL3 & FUSE_SUT0,
|
||||
.high = FUSE_SPIEN & FUSE_BOOTSZ0 & FUSE_BOOTSZ1,
|
||||
.extended = EFUSE_DEFAULT,
|
||||
};
|
||||
#else
|
||||
#warning No fuse definitions for this chip in fuses.h!
|
||||
#endif
|
||||
Loading…
Reference in New Issue