From 5d40a2afcc98ef87bed45e70483f81822844fe5e Mon Sep 17 00:00:00 2001 From: majekw Date: Mon, 8 Oct 2018 23:35:30 +0200 Subject: [PATCH 1/2] Fix compilation of attiny828at8_5v and atmega168 BIGBOOT=1 --- optiboot/bootloaders/optiboot/Makefile | 2 +- optiboot/bootloaders/optiboot/Makefile.MCUdude | 18 +++++++++--------- optiboot/bootloaders/optiboot/Makefile.tiny | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/optiboot/bootloaders/optiboot/Makefile b/optiboot/bootloaders/optiboot/Makefile index d214027..3f923a8 100644 --- a/optiboot/bootloaders/optiboot/Makefile +++ b/optiboot/bootloaders/optiboot/Makefile @@ -381,7 +381,7 @@ atmega168: AVR_FREQ ?= 16000000L ifndef BIGBOOT atmega168: LDSECTIONS = -Wl,--section-start=.text=0x3e00 -Wl,--section-start=.version=0x3ffe else -atmeg168: LDSECTIONS = -Wl,--section-start=.text=0x3c00 -Wl,--section-start=.version=0x3ffe +atmega168: LDSECTIONS = -Wl,--section-start=.text=0x3c00 -Wl,--section-start=.version=0x3ffe endif atmega168: $(PROGRAM)_atmega168.hex ifndef PRODUCTION diff --git a/optiboot/bootloaders/optiboot/Makefile.MCUdude b/optiboot/bootloaders/optiboot/Makefile.MCUdude index 561a6eb..a0f10c3 100644 --- a/optiboot/bootloaders/optiboot/Makefile.MCUdude +++ b/optiboot/bootloaders/optiboot/Makefile.MCUdude @@ -115,15 +115,15 @@ endif atmega164pa: atmega164p #ATmega168/A -atmega168: TARGET = atmega168 -atmega168: MCU_TARGET = atmega168 -atmega168: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD) -atmega168: AVR_FREQ ?= 16000000L -atmega168: LDSECTIONS = -Wl,--section-start=.text=0x3e00 -Wl,--section-start=.version=0x3ffe -atmega168: $(PROGRAM)_atmega168_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex -ifndef PRODUCTION -atmega168: $(PROGRAM)_atmega168_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst -endif +#atmega168: TARGET = atmega168 +#atmega168: MCU_TARGET = atmega168 +#atmega168: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD) +#atmega168: AVR_FREQ ?= 16000000L +#atmega168: LDSECTIONS = -Wl,--section-start=.text=0x3e00 -Wl,--section-start=.version=0x3ffe +#atmega168: $(PROGRAM)_atmega168_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex +#ifndef PRODUCTION +#atmega168: $(PROGRAM)_atmega168_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst +#endif atmega168a: atmega168 #ATmega168P/PA diff --git a/optiboot/bootloaders/optiboot/Makefile.tiny b/optiboot/bootloaders/optiboot/Makefile.tiny index 27920a2..8e79b40 100644 --- a/optiboot/bootloaders/optiboot/Makefile.tiny +++ b/optiboot/bootloaders/optiboot/Makefile.tiny @@ -353,7 +353,7 @@ ifndef PRODUCTION endif attiny828at8_5v: - $(MAKE) attiny828at8 AVR_FREQ=8200000L BAUD_RATE=57600 + $(MAKE) attiny828 AVR_FREQ=8200000L BAUD_RATE=57600 mv $(PROGRAM)_attiny828.hex $(PROGRAM)_$@.hex ifndef PRODUCTION mv $(PROGRAM)_attiny828.lst $(PROGRAM)_$@.lst From e866cae9d7844529fc75328a851819edd193385a Mon Sep 17 00:00:00 2001 From: majekw Date: Tue, 9 Oct 2018 23:42:35 +0200 Subject: [PATCH 2/2] Fix attiny84 and possible other chips without hardware UART --- optiboot/bootloaders/optiboot/pin_defs.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/optiboot/bootloaders/optiboot/pin_defs.h b/optiboot/bootloaders/optiboot/pin_defs.h index 5e9520f..2dc7d47 100644 --- a/optiboot/bootloaders/optiboot/pin_defs.h +++ b/optiboot/bootloaders/optiboot/pin_defs.h @@ -42,6 +42,7 @@ * Note that mega8/m32 still needs special handling, because ubrr is handled * differently. */ +#ifndef SOFT_UART #if UART == 0 #if defined(UDR0) # define UART_SRA UCSR0A @@ -93,6 +94,7 @@ # define UART_SRL UBRR3L # define UART_UDR UDR3 #endif +#endif #if defined(__AVR_ATmega8__) \ || defined (__AVR_ATmega32__) \