Makefile: clarify definition of the firmware upload device in use.
Programmers typically don't do baud rate, so setting the avrdude -b flag has to be avoided in this case.
This commit is contained in:
parent
a2f1412aec
commit
7f3c1e61ba
43
Makefile
43
Makefile
|
|
@ -62,15 +62,28 @@ AVRDUDECONF = /etc/avrdude.conf
|
||||||
PROGPORT = /dev/arduino
|
PROGPORT = /dev/arduino
|
||||||
# PROGPORT = /dev/ttyUSB0
|
# PROGPORT = /dev/ttyUSB0
|
||||||
|
|
||||||
# atmega168
|
##############################################################################
|
||||||
#PROGBAUD = 19200
|
# #
|
||||||
# atmega328p, 644p, 1280
|
# This depends on the bootloader (or programmer) in use. #
|
||||||
PROGBAUD = 57600
|
# Examples: #
|
||||||
# atmega 2560
|
# #
|
||||||
# PROGBAUD = 115200
|
# Arduino Diecimilia with genuine bootloader: 19200 #
|
||||||
|
# Sanguino bootloader: 57600 #
|
||||||
|
# Gen7 bootloader: 115200 #
|
||||||
|
# #
|
||||||
|
# Set PROGBAUD to 0 (Zero) for programmers. #
|
||||||
|
# #
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
# at least mega2560 needs stk500v2
|
PROGBAUD = 115200
|
||||||
PROGID = arduino
|
|
||||||
|
##############################################################################
|
||||||
|
# #
|
||||||
|
# Firmware upload device type. Typically stk500 or stk500v2. #
|
||||||
|
# #
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
PROGID = stk500v2
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# #
|
# #
|
||||||
|
|
@ -104,6 +117,12 @@ else
|
||||||
SOURCES += serial.c
|
SOURCES += serial.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(PROGBAUD),0)
|
||||||
|
PROGBAUD_FLAG =
|
||||||
|
else
|
||||||
|
PROGBAUD_FLAG = -b$(PROGBAUD)
|
||||||
|
endif
|
||||||
|
|
||||||
OBJ = $(patsubst %.c,%.o,${SOURCES})
|
OBJ = $(patsubst %.c,%.o,${SOURCES})
|
||||||
|
|
||||||
.PHONY: all program clean size subdirs program-fuses doc functionsbysize
|
.PHONY: all program clean size subdirs program-fuses doc functionsbysize
|
||||||
|
|
@ -122,16 +141,16 @@ program: $(PROGRAM).hex config.h
|
||||||
stty $(PROGBAUD) raw ignbrk hup < $(PROGPORT)
|
stty $(PROGBAUD) raw ignbrk hup < $(PROGPORT)
|
||||||
@sleep 0.1
|
@sleep 0.1
|
||||||
@stty $(PROGBAUD) raw ignbrk hup < $(PROGPORT)
|
@stty $(PROGBAUD) raw ignbrk hup < $(PROGPORT)
|
||||||
$(AVRDUDE) -c$(PROGID) -b$(PROGBAUD) -p$(MCU_TARGET) -P$(PROGPORT) -C$(AVRDUDECONF) -U flash:w:$^
|
$(AVRDUDE) -c$(PROGID) $(PROGBAUD_FLAG) -p$(MCU_TARGET) -P$(PROGPORT) -C$(AVRDUDECONF) -U flash:w:$^
|
||||||
stty 115200 raw ignbrk -hup -echo ixoff < $(PROGPORT)
|
stty 115200 raw ignbrk -hup -echo ixoff < $(PROGPORT)
|
||||||
|
|
||||||
program-fuses:
|
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"' > 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"' > hfuse
|
||||||
avr-objdump -s -j .fuse mendel.o | perl -ne '/\s0000\s....([0-9a-f]{2})/ && print "$$1\n"' > efuse
|
avr-objdump -s -j .fuse mendel.o | perl -ne '/\s0000\s....([0-9a-f]{2})/ && print "$$1\n"' > efuse
|
||||||
$(AVRDUDE) -c$(PROGID) -b$(PROGBAUD) -p$(MCU_TARGET) -P$(PROGPORT) -C$(AVRDUDECONF) -U lfuse:w:lfuse
|
$(AVRDUDE) -c$(PROGID) $(PROGBAUD_FLAG) -p$(MCU_TARGET) -P$(PROGPORT) -C$(AVRDUDECONF) -U lfuse:w:lfuse
|
||||||
$(AVRDUDE) -c$(PROGID) -b$(PROGBAUD) -p$(MCU_TARGET) -P$(PROGPORT) -C$(AVRDUDECONF) -U hfuse:w:hfuse
|
$(AVRDUDE) -c$(PROGID) $(PROGBAUD_FLAG) -p$(MCU_TARGET) -P$(PROGPORT) -C$(AVRDUDECONF) -U hfuse:w:hfuse
|
||||||
$(AVRDUDE) -c$(PROGID) -b$(PROGBAUD) -p$(MCU_TARGET) -P$(PROGPORT) -C$(AVRDUDECONF) -U efuse:w:efuse
|
$(AVRDUDE) -c$(PROGID) $(PROGBAUD_FLAG) -p$(MCU_TARGET) -P$(PROGPORT) -C$(AVRDUDECONF) -U efuse:w:efuse
|
||||||
|
|
||||||
clean: clean-subdirs
|
clean: clean-subdirs
|
||||||
rm -rf *.o *.elf *.lst *.map *.sym *.lss *.eep *.srec *.bin *.hex *.al *.i *.s *~ *fuse
|
rm -rf *.o *.elf *.lst *.map *.sym *.lss *.eep *.srec *.bin *.hex *.al *.i *.s *~ *fuse
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue