Skip to content

Commit

Permalink
Add bigboot support to USB-MCUs and correct wrong bootsize for atmega…
Browse files Browse the repository at this point in the history
…16u4
  • Loading branch information
Virtual-Java committed Oct 3, 2021
1 parent 89ea5b2 commit 91e55f2
Show file tree
Hide file tree
Showing 4 changed files with 248 additions and 16 deletions.
222 changes: 207 additions & 15 deletions optiboot/bootloaders/optiboot/Makefile.usbmcus
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ HELPTEXT += "target atmega8/16/32u2, atmega16/32u4 - newer 32/44pin AVR-USB-MCUs
atmega8u2atUART: TARGET = atmega8u2
atmega8u2atUART: MCU_TARGET = atmega8u2
atmega8u2atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega8u2atUART: AVR_FREQ ?= 16000000L
atmega8u2atUART: AVR_FREQ ?= 16000000L
ifndef BIGBOOT ## standard version is 512 Bytes long; starts earlier
atmega8u2atUART: LDSECTIONS = -Wl,--section-start=.text=0x1e00 -Wl,--section-start=.version=0x1ffe
else ## bigboot version is 1024 Bytes long; starts earlier
atmega8u2atUART: LDSECTIONS = -Wl,--section-start=.text=0x1c00 -Wl,--section-start=.version=0x1ffe
endif
atmega8u2atUART: $(PROGRAM)_atmega8u2_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega8u2atUART: $(PROGRAM)_atmega8u2_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
Expand All @@ -34,7 +38,11 @@ atmega8u2:
atmega8u2_isp: atmega8u2
atmega8u2_isp: TARGET = atmega8u2
atmega8u2_isp: MCU_TARGET = atmega8u2
atmega8u2_isp: HFUSE ?= DE# = 512 byte boot, JTAG disabled
ifndef BIGBOOT ## standard version is 512 Bytes long; starts earlier
atmega8u2_isp: HFUSE ?= DE# = 512 byte boot, SPI (ISP!!!) enabled, JTAG disabled
else ## bigboot version is 1024 Bytes long; starts earlier
atmega8u2_isp: HFUSE ?= DC# = 1024 byte boot, SPI (ISP!!!) enabled, JTAG disabled
endif
atmega8u2_isp: LFUSE ?= FF# = Full Swing xtal (16MHz) 16KCK/14CK+65ms
atmega8u2_isp: EFUSE ?= FE# = 2.7V brownout
atmega8u2_isp: LOCK ?= 2F# = APP protect mode 1, BL protect mode 2
Expand All @@ -48,8 +56,12 @@ atmega8u2_isp: isp
atmega16u2atUART: TARGET = atmega16u2
atmega16u2atUART: MCU_TARGET = atmega16u2
atmega16u2atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega16u2atUART: AVR_FREQ ?= 16000000L
atmega16u2atUART: AVR_FREQ ?= 16000000L
ifndef BIGBOOT ## standard version is 512 Bytes long; starts earlier
atmega16u2atUART: LDSECTIONS = -Wl,--section-start=.text=0x3e00 -Wl,--section-start=.version=0x3ffe
else ## bigboot version is 1024 Bytes long; starts earlier
atmega16u2atUART: LDSECTIONS = -Wl,--section-start=.text=0x3c00 -Wl,--section-start=.version=0x3ffe
endif
atmega16u2atUART: $(PROGRAM)_atmega16u2_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega16u2atUART: $(PROGRAM)_atmega16u2_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
Expand All @@ -60,7 +72,11 @@ atmega16u2:
atmega16u2_isp: atmega16u2
atmega16u2_isp: TARGET = atmega16u2
atmega16u2_isp: MCU_TARGET = atmega16u2
atmega16u2_isp: HFUSE ?= DE# = 512 byte boot, JTAG disabled
ifndef BIGBOOT ## standard version is 512 Bytes long; starts earlier
atmega16u2_isp: HFUSE ?= DE# = 512 byte boot, SPI (ISP!!!) enabled, JTAG disabled
else ## bigboot version is 1024 Bytes long; starts earlier
atmega16u2_isp: HFUSE ?= DC# = 1024 byte boot, SPI (ISP!!!) enabled, JTAG disabled
endif
atmega16u2_isp: LFUSE ?= FF# = Full Swing xtal (16MHz) 16KCK/14CK+65ms
atmega16u2_isp: EFUSE ?= FE# = 2.7V brownout
atmega16u2_isp: LOCK ?= 2F# = APP protect mode 1, BL protect mode 2
Expand All @@ -74,8 +90,12 @@ atmega16u2_isp: isp
atmega32u2atUART: TARGET = atmega32u2
atmega32u2atUART: MCU_TARGET = atmega32u2
atmega32u2atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega32u2atUART: AVR_FREQ ?= 16000000L
atmega32u2atUART: AVR_FREQ ?= 16000000L
ifndef BIGBOOT ## standard version is 512 Bytes long; starts earlier
atmega32u2atUART: LDSECTIONS = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
else ## bigboot version is 1024 Bytes long; starts earlier
atmega32u2atUART: LDSECTIONS = -Wl,--section-start=.text=0x7c00 -Wl,--section-start=.version=0x7ffe
endif
atmega32u2atUART: $(PROGRAM)_atmega32u2_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega32u2atUART: $(PROGRAM)_atmega32u2_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
Expand All @@ -86,7 +106,11 @@ atmega32u2:
atmega32u2_isp: atmega32u2
atmega32u2_isp: TARGET = atmega32u2
atmega32u2_isp: MCU_TARGET = atmega32u2
atmega32u2_isp: HFUSE ?= DE# = 512 byte boot, JTAG disabled
ifndef BIGBOOT ## standard version is 512 Bytes long; starts earlier
atmega32u2_isp: HFUSE ?= DE# = 512 byte boot, SPI (ISP!!!) enabled, JTAG disabled
else ## bigboot version is 1024 Bytes long; starts earlier
atmega32u2_isp: HFUSE ?= DC# = 1024 byte boot, SPI (ISP!!!) enabled, JTAG disabled
endif
atmega32u2_isp: LFUSE ?= FF# = Full Swing xtal (16MHz) 16KCK/14CK+65ms
atmega32u2_isp: EFUSE ?= FE# = 2.7V brownout
atmega32u2_isp: LOCK ?= 2F# = APP protect mode 1, BL protect mode 2
Expand All @@ -100,8 +124,12 @@ atmega32u2_isp: isp
atmega16u4atUART: TARGET = atmega16u4
atmega16u4atUART: MCU_TARGET = atmega16u4
atmega16u4atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega16u4atUART: AVR_FREQ ?= 16000000L
atmega16u4atUART: LDSECTIONS = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
atmega16u4atUART: AVR_FREQ ?= 16000000L
ifndef BIGBOOT ## standard version is 512 Bytes long; starts earlier
atmega16u4atUART: LDSECTIONS = -Wl,--section-start=.text=0x3e00 -Wl,--section-start=.version=0x3ffe
else ## bigboot version is 1024 Bytes long; starts earlier
atmega16u4atUART: LDSECTIONS = -Wl,--section-start=.text=0x3c00 -Wl,--section-start=.version=0x3ffe
endif
atmega16u4atUART: $(PROGRAM)_atmega16u4_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega16u4atUART: $(PROGRAM)_atmega16u4_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
Expand All @@ -113,7 +141,11 @@ atmega16u4:
atmega16u4_isp: atmega16u4
atmega16u4_isp: TARGET = atmega16u4
atmega16u4_isp: MCU_TARGET = atmega16u4
atmega16u4_isp: HFUSE ?= DE# = 512 byte boot, JTAG disabled
ifndef BIGBOOT ## standard version is 512 Bytes long; starts earlier
atmega16u4_isp: HFUSE ?= DE# = 512 byte boot, SPI (ISP!!!) enabled, JTAG disabled
else ## bigboot version is 1024 Bytes long; starts earlier
atmega16u4_isp: HFUSE ?= DC# = 1024 byte boot, SPI (ISP!!!) enabled, JTAG disabled
endif
atmega16u4_isp: LFUSE ?= FF# = Full Swing xtal (16MHz) 16KCK/14CK+65ms
atmega16u4_isp: EFUSE ?= FB# = 2.6V brownout
atmega16u4_isp: LOCK ?= 2F# = APP protect mode 1, BL protect mode 2
Expand All @@ -127,8 +159,12 @@ atmega16u4_isp: isp
atmega32u4atUART: TARGET = atmega32u4
atmega32u4atUART: MCU_TARGET = atmega32u4
atmega32u4atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega32u4atUART: AVR_FREQ ?= 16000000L
atmega32u4atUART: AVR_FREQ ?= 16000000L
ifndef BIGBOOT ## standard version is 512 Bytes long; starts earlier
atmega32u4atUART: LDSECTIONS = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
else ## bigboot version is 1024 Bytes long; starts earlier
atmega32u4atUART: LDSECTIONS = -Wl,--section-start=.text=0x7c00 -Wl,--section-start=.version=0x7ffe
endif
atmega32u4atUART: $(PROGRAM)_atmega32u4_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega32u4atUART: $(PROGRAM)_atmega32u4_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
Expand All @@ -140,7 +176,11 @@ atmega32u4:
atmega32u4_isp: atmega32u4
atmega32u4_isp: TARGET = atmega32u4
atmega32u4_isp: MCU_TARGET = atmega32u4
atmega32u4_isp: HFUSE ?= DE# = 512 byte boot, JTAG disabled
ifndef BIGBOOT ## standard version is 512 Bytes long; starts earlier
atmega32u4_isp: HFUSE ?= DE# = 512 byte boot, SPI (ISP!!!) enabled, JTAG disabled
else ## bigboot version is 1024 Bytes long; starts earlier
atmega32u4_isp: HFUSE ?= DC# = 1024 byte boot, SPI (ISP!!!) enabled, JTAG disabled
endif
atmega32u4_isp: LFUSE ?= FF# = Full Swing xtal (16MHz) 16KCK/14CK+65ms
atmega32u4_isp: EFUSE ?= FB# = 2.6V brownout
atmega32u4_isp: LOCK ?= 2F# = APP protect mode 1, BL protect mode 2
Expand All @@ -154,22 +194,174 @@ atmega32u4_isp: isp
atmega32u6atUART: TARGET = atmega32u6
atmega32u6atUART: MCU_TARGET = atmega32u6
atmega32u6atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega32u6atUART: AVR_FREQ ?= 16000000L
atmega32u6atUART: AVR_FREQ ?= 16000000L
ifndef BIGBOOT ## standard version is 512 Bytes long; starts earlier
atmega32u6atUART: LDSECTIONS = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
else ## bigboot version is 1024 Bytes long; starts earlier
atmega32u6atUART: LDSECTIONS = -Wl,--section-start=.text=0x7c00 -Wl,--section-start=.version=0x7ffe
endif
atmega32u6atUART: $(PROGRAM)_atmega32u6_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega32u6atUART: $(PROGRAM)_atmega32u6_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
endif
atmega32u6:
# disable blinking the LED to make the bootloader to fit in 512 Bytes Bootsection
"$(MAKE)" atmega32u6atUART UART?=1

atmega32u6_isp: atmega32u6
atmega32u6_isp: TARGET = atmega32u6
atmega32u6_isp: MCU_TARGET = atmega32u6
atmega32u6_isp: HFUSE ?= DE# = 512 byte boot, JTAG disabled
atmega32u6_isp: MCU_TARGET = atmega32u6
ifndef BIGBOOT ## standard version is 512 Bytes long; starts earlier
atmega32u6_isp: HFUSE ?= DE# = 512 byte boot, SPI (ISP!!!) enabled, JTAG disabled
else ## bigboot version is 1024 Bytes long; starts earlier
atmega32u6_isp: HFUSE ?= DC# = 1024 byte boot, SPI (ISP!!!) enabled, JTAG disabled
endif
atmega32u6_isp: LFUSE ?= FF# = Full Swing xtal (16MHz) 16KCK/14CK+65ms
atmega32u6_isp: EFUSE ?= FB# = 2.6V brownout
atmega32u6_isp: LOCK ?= 2F# = APP protect mode 1, BL protect mode 2
atmega32u6_isp: isp


#-----------------------
# AT90USB646
#-----------------------
#at90usb646
at90usb646atUART: TARGET = at90usb646
at90usb646atUART: MCU_TARGET = at90usb646
at90usb646atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
at90usb646atUART: AVR_FREQ ?= 16000000L
ifndef BIGBOOT ## standard version is 512 Bytes long; starts earlier
at90usb646atUART: LDSECTIONS = -Wl,--section-start=.text=0xfc00 -Wl,--section-start=.version=0xfffe
else ## bigboot version is 1024 Bytes long; starts earlier
at90usb646atUART: LDSECTIONS = -Wl,--section-start=.text=0xf800 -Wl,--section-start=.version=0xfffe
endif
at90usb646atUART: $(PROGRAM)_at90usb646_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
at90usb646atUART: $(PROGRAM)_at90usb646_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
endif
at90usb646:
"$(MAKE)" at90usb646atUART UART?=1

at90usb646_isp: at90usb646
at90usb646_isp: TARGET = at90usb646
at90usb646_isp: MCU_TARGET = at90usb646
ifndef BIGBOOT ## standard version is 1024 Bytes long; starts earlier
at90usb646_isp: HFUSE ?= DE# = 1024 byte boot, SPI (ISP!!!) enabled, JTAG disabled
else ## bigboot version is 2048 Bytes long; starts earlier
at90usb646_isp: HFUSE ?= DC# = 2048 byte boot, SPI (ISP!!!) enabled, JTAG disabled
endif
at90usb646_isp: LFUSE ?= FF# = Full Swing xtal (16MHz) 16KCK/14CK+65ms
at90usb646_isp: EFUSE ?= FB# = 2.6V brownout
at90usb646_isp: LOCK ?= 2F# = APP protect mode 1, BL protect mode 2
at90usb646_isp: isp


#-----------------------
# AT90USB647
#-----------------------
#at90usb647
at90usb647atUART: TARGET = at90usb647
at90usb647atUART: MCU_TARGET = at90usb647
at90usb647atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
at90usb647atUART: AVR_FREQ ?= 16000000L
ifndef BIGBOOT ## standard version is 1024 Bytes long; starts earlier
at90usb647atUART: LDSECTIONS = -Wl,--section-start=.text=0xfc00 -Wl,--section-start=.version=0xfffe
else ## bigboot version is 2048 Bytes long; starts earlier
at90usb647atUART: LDSECTIONS = -Wl,--section-start=.text=0xf800 -Wl,--section-start=.version=0xfffe
endif
at90usb647atUART: $(PROGRAM)_at90usb647_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
at90usb647atUART: $(PROGRAM)_at90usb647_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
endif
at90usb647:
"$(MAKE)" at90usb647atUART UART?=1

at90usb647_isp: at90usb647
at90usb647_isp: TARGET = at90usb647
at90usb647_isp: MCU_TARGET = at90usb647
ifndef BIGBOOT ## standard version is 1024 Bytes long; starts earlier
at90usb647_isp: HFUSE ?= DE# = 1024 byte boot, SPI (ISP!!!) enabled, JTAG disabled
else ## bigboot version is 2048 Bytes long; starts earlier
at90usb647_isp: HFUSE ?= DC# = 2048 byte boot, SPI (ISP!!!) enabled, JTAG disabled
endif
at90usb647_isp: LFUSE ?= FF# = Full Swing xtal (16MHz) 16KCK/14CK+65ms
at90usb647_isp: EFUSE ?= FB# = 2.6V brownout
at90usb647_isp: LOCK ?= 2F# = APP protect mode 1, BL protect mode 2
at90usb647_isp: isp


#-----------------------
# AT90USB1286
#-----------------------
#at90usb1286
at90usb1286atUART: TARGET = at90usb1286
at90usb1286atUART: MCU_TARGET = at90usb1286
at90usb1286atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
at90usb1286atUART: AVR_FREQ ?= 16000000L
ifndef BIGBOOT ## standard version is 1024 Bytes long; starts earlier
at90usb1286atUART: LDSECTIONS = -Wl,--section-start=.text=0x1fc00 -Wl,--section-start=.version=0x1fffe
else ## bigboot version is 2048 Bytes long; starts earlier
at90usb1286atUART: LDSECTIONS = -Wl,--section-start=.text=0x1f800 -Wl,--section-start=.version=0x1fffe
endif
at90usb1286atUART: $(PROGRAM)_at90usb1286_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
at90usb1286atUART: $(PROGRAM)_at90usb1286_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
endif
at90usb1286:
"$(MAKE)" at90usb1286atUART UART?=1

at90usb1286_isp: at90usb1286
at90usb1286_isp: TARGET = at90usb1286
at90usb1286_isp: MCU_TARGET = at90usb1286
ifndef BIGBOOT ## standard version is 1024 Bytes long; starts earlier
at90usb1286_isp: HFUSE ?= DE# = 1024 byte boot, SPI (ISP!!!) enabled, JTAG disabled
else ## bigboot version is 2048 Bytes long; starts earlier
at90usb1286_isp: HFUSE ?= DC# = 2048 byte boot, SPI (ISP!!!) enabled, JTAG disabled
endif
at90usb1286_isp: LFUSE ?= FF# = Full Swing xtal (16MHz) 16KCK/14CK+65ms
at90usb1286_isp: EFUSE ?= FB# = 2.6V brownout
at90usb1286_isp: LOCK ?= 2F# = APP protect mode 1, BL protect mode 2
at90usb1286_isp: isp


#-----------------------
# AT90USB1287
#-----------------------
#at90usb1287
at90usb1287atUART: TARGET = at90usb1287
at90usb1287atUART: MCU_TARGET = at90usb1287
at90usb1287atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
at90usb1287atUART: AVR_FREQ ?= 16000000L
ifndef BIGBOOT ## standard version is 1024 Bytes long; starts earlier
at90usb1287atUART: LDSECTIONS = -Wl,--section-start=.text=0x1fc00 -Wl,--section-start=.version=0x1fffe
else ## bigboot version is 2048 Bytes long; starts earlier
at90usb1287atUART: LDSECTIONS = -Wl,--section-start=.text=0x1f800 -Wl,--section-start=.version=0x1fffe
endif
#at90usb1287atUART: OUTPUT_FILE_ROOT=$(PROGRAM)_$(TARGET)_UART${UART:-"d_d"}_$(BAUD_RATE)_$(AVR_FREQ)
#at90usb1287atUART: $(OUTPUT_FILE_ROOT).hex
test=atm1
at90usb1287atUART: $(PROGRAM)_${test:-"ddd"}_UART${UART_CMD:-"d_d"}_$(BAUD_RATE)_$(AVR_FREQ).hex

#at90usb1287atUART: $(PROGRAM)_at90usb1287_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
#at90usb1287atUART: $(PROGRAM)_$(TARGET)_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst

#at90usb1287atUART: $(OUTPUT_FILE_ROOT).lst
#at90usb1287atUART: $(PROGRAM)_at90usb1287_UART${UART:? "d_d"}_$(BAUD_RATE)_$(AVR_FREQ).lst
at90usb1287atUART: $(PROGRAM)_at90usb1287_${(UART):-"d_d"}_$(BAUD_RATE)_$(AVR_FREQ).lst
endif
at90usb1287:
"$(MAKE)" at90usb1287atUART UART?=1

at90usb1287_isp: at90usb1287
at90usb1287_isp: TARGET = at90usb1287
at90usb1287_isp: MCU_TARGET = at90usb1287
ifndef BIGBOOT ## standard version is 1024 Bytes long; starts earlier
at90usb1287_isp: HFUSE ?= DE# = 1024 byte boot, SPI (ISP!!!) enabled, JTAG disabled
else ## bigboot version is 2048 Bytes long; starts earlier
at90usb1287_isp: HFUSE ?= DC# = 2048 byte boot, SPI (ISP!!!) enabled, JTAG disabled
endif
at90usb1287_isp: LFUSE ?= FF# = Full Swing xtal (16MHz) 16KCK/14CK+65ms
at90usb1287_isp: EFUSE ?= FB# = 2.6V brownout
at90usb1287_isp: LOCK ?= 2F# = APP protect mode 1, BL protect mode 2
at90usb1287_isp: isp

4 changes: 4 additions & 0 deletions optiboot/bootloaders/optiboot/makeall.usbmcus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ declare -a mcu_and_params=(
"atmega16u4" "LED=C7 LED_START_FLASHES=0 UART=1" # disable blinking the LED to make the bootloader to fit in 512 Bytes Bootsection
"atmega32u4" "LED=C7 LED_START_FLASHES=0 UART=1" # disable blinking the LED to make the bootloader to fit in 512 Bytes Bootsection
"atmega32u6" "LED=C6 LED_START_FLASHES=2 UART=1" # for some reason it is not necessary to disable blinking the LED for this device
"at90usb646" "LED=C6 LED_START_FLASHES=2 UART=1 BIGBOOT=1" # enable bigboot since at90usbXYZS devices have minimal bootsection of 1048 Bytes
"at90usb647" "LED=C6 LED_START_FLASHES=2 UART=1 BIGBOOT=1" # enable bigboot since at90usbXYZS devices have minimal bootsection of 1048 Bytes
"at90usb1286" "LED=C6 LED_START_FLASHES=2 UART=1 BIGBOOT=1" # enable bigboot since at90usbXYZS devices have minimal bootsection of 1048 Bytes
"at90usb1287" "LED=C6 LED_START_FLASHES=2 UART=1 BIGBOOT=1" # enable bigboot since at90usbXYZS devices have minimal bootsection of 1048 Bytes
)

declare -a clock_and_baud=(
Expand Down
24 changes: 24 additions & 0 deletions optiboot/bootloaders/optiboot/makeoptions
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,27 @@ make atmega328 UART=1
#invalid bit rates
make atmega328 BAUD_RATE=300
make atmega328 BAUD_RATE=3000000

# ===========\
# usbmcus ==>
# ===========/

# atmegaXYu4
make atmega8u2 LED=D5 BAUD_RATE=115200 # default
make atmega16u2 LED=D5 BAUD_RATE=115200 # default
make atmega32u2 LED=D5 BAUD_RATE=115200 # default

# atmegaXYu4
# disable led blinking at startup to save memory
make atmega16u4 LED=C7 LED_START_FLASHES=0 # default
make atmega32u4 LED=C7 LED_START_FLASHES=0 # default
# use a 1048 Byte bootsection to enable the led
make atmega16u4 LED=C7 LED_START_FLASHES=2 BIGBOOT=1
make atmega32u4 LED=C7 LED_START_FLASHES=2 BIGBOOT=1
make atmega32u6 LED=C6 LED_START_FLASHES=2 # default

# at90usbXYZ6/7
make at90usb646 LED=C6 LED_START_FLASHES=2 BIGBOOT=1 # default
make at90usb647 LED=C6 LED_START_FLASHES=2 BIGBOOT=1 # default
make at90usb1286 LED=C6 LED_START_FLASHES=2 BIGBOOT=1 # default
make at90usb1287 LED=C6 LED_START_FLASHES=2 BIGBOOT=1 # default
14 changes: 13 additions & 1 deletion optiboot/bootloaders/optiboot/pin_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,9 @@

/*------------------------------------------------------------------------ */
#if defined(__AVR_ATmega8U2__) || defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__) \
|| (__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega32U6__)
|| defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega32U6__) \
|| defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) \
|| defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__)
/*------------------------------------------------------------------------ */
/* Fix different register names */
#define MPCM0 MPCM1
Expand Down Expand Up @@ -549,6 +551,16 @@
#endif
#endif // AtmegaXYu6

/*------------------------------------------------------------------------ */
#if defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) \
|| defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__)
/*------------------------------------------------------------------------ */

#if !defined(LED)
#define LED C6 // because of PWM (OSC3A)
#endif
#endif // At90usbXYz6/7


#endif // usbmcus

Expand Down

0 comments on commit 91e55f2

Please sign in to comment.