1
0
mirror of https://github.com/Optiboot/optiboot.git synced 2025-07-04 16:42:25 +03:00

Custom linker script.

Implement a hack to derive section start addresses from the
information like FLASHEND that is present in the source code (via
io.h) This requires a custom linker script that uses symbols defined
by inline ASM in the C program, the inline ASM itself, and some
calculations/guesswork to figure out bootloader size for those
VIRTUAL_BOOT platforms that have a bootloader size larger than 512
bytes but significantly smaller than 1024 bytes.
This commit is contained in:
WestfW
2021-11-04 18:08:45 -07:00
parent 68b7a55b1e
commit be65a28adb
16 changed files with 2184 additions and 1470 deletions

View File

@ -60,7 +60,7 @@ export
# defaults
MCU_TARGET = atmega168
LDSECTIONS = -Wl,--section-start=.text=0x3e00 -Wl,--section-start=.version=0x3ffe
LDSECTIONS = -Wl,-Tlink_optiboot.ld
# Build environments
# Start of some ugly makefile-isms to allow optiboot to be built
@ -349,8 +349,6 @@ virboot8: TARGET = atmega8
virboot8: MCU_TARGET = atmega8
virboot8: CFLAGS += $(COMMON_OPTIONS) '-DVIRTUAL_BOOT_PARTITION' '-Dsave_vect_num=EE_RDY_vect_num'
virboot8: AVR_FREQ ?= 16000000L
# Start address of 1D80 allows for size up to 640 bytes, app up to 7552
virboot8: LDSECTIONS = -Wl,--section-start=.text=0x1d80 -Wl,--section-start=.version=0x1ffe
virboot8: $(PROGRAM)_virboot8.hex
ifndef PRODUCTION
virboot8: $(PROGRAM)_virboot8.lst
@ -362,7 +360,6 @@ virboot328: TARGET = atmega328
virboot328: MCU_TARGET = atmega328p
virboot328: CFLAGS += $(COMMON_OPTIONS) '-DVIRTUAL_BOOT_PARTITION'
virboot328: AVR_FREQ ?= 16000000L
virboot328: LDSECTIONS = -Wl,--section-start=.text=0x7d80 -Wl,--section-start=.version=0x7ffe
virboot328: $(PROGRAM)_virboot328.hex
ifndef PRODUCTION
virboot328: $(PROGRAM)_virboot328.lst
@ -403,11 +400,6 @@ atmega8: TARGET = atmega8
atmega8: MCU_TARGET = atmega8
atmega8: CFLAGS += $(COMMON_OPTIONS)
atmega8: AVR_FREQ ?= 16000000L
ifndef BIGBOOT
atmega8: LDSECTIONS = -Wl,--section-start=.text=0x1e00 -Wl,--section-start=.version=0x1ffe -Wl,--gc-sections -Wl,--undefined=optiboot_version
else
atmega8: LDSECTIONS = -Wl,--section-start=.text=0x1c00 -Wl,--section-start=.version=0x1ffe -Wl,--gc-sections -Wl,--undefined=optiboot_version
endif
atmega8: $(PROGRAM)_atmega8.hex
ifndef PRODUCTION
atmega8: $(PROGRAM)_atmega8.lst
@ -432,11 +424,6 @@ atmega168: TARGET = atmega168
atmega168: MCU_TARGET = atmega168
atmega168: CFLAGS += $(COMMON_OPTIONS)
atmega168: AVR_FREQ ?= 16000000L
ifndef BIGBOOT
atmega168: LDSECTIONS = -Wl,--section-start=.text=0x3e00 -Wl,--section-start=.version=0x3ffe
else
atmega168: LDSECTIONS = -Wl,--section-start=.text=0x3c00 -Wl,--section-start=.version=0x3ffe
endif
atmega168: $(PROGRAM)_atmega168.hex
ifndef PRODUCTION
atmega168: $(PROGRAM)_atmega168.lst
@ -462,12 +449,6 @@ atmega328: TARGET = atmega328
atmega328: MCU_TARGET = atmega328p
atmega328: CFLAGS += $(COMMON_OPTIONS)
atmega328: AVR_FREQ ?= 16000000L
ifndef BIGBOOT
atmega328: LDSECTIONS = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
else
# bigboot version is 1k long; starts earlier
atmega328: LDSECTIONS = -Wl,--section-start=.text=0x7c00 -Wl,--section-start=.version=0x7ffe
endif
atmega328: $(PROGRAM)_atmega328.hex
ifndef PRODUCTION
atmega328: $(PROGRAM)_atmega328.lst
@ -494,7 +475,6 @@ atmega328_isp: isp
atmega1280: MCU_TARGET = atmega1280
atmega1280: CFLAGS += $(COMMON_OPTIONS) -DBIGBOOT $(UART_CMD)
atmega1280: AVR_FREQ ?= 16000000L
atmega1280: LDSECTIONS = -Wl,--section-start=.text=0x1fc00 -Wl,--section-start=.version=0x1fffe
atmega1280: $(PROGRAM)_atmega1280.hex
ifndef PRODUCTION
atmega1280: $(PROGRAM)_atmega1280.lst

View File

@ -12,7 +12,6 @@ atmega644p: TARGET = atmega644p
atmega644p: MCU_TARGET = atmega644p
atmega644p: CFLAGS += $(COMMON_OPTIONS) -DBIGBOOT
atmega644p: AVR_FREQ ?= 16000000L
atmega644p: LDSECTIONS = -Wl,--section-start=.text=0xfc00 -Wl,--section-start=.version=0xfffe
atmega644p: CFLAGS += $(UART_CMD)
atmega644p: $(PROGRAM)_atmega644p.hex
ifndef PRODUCTION
@ -24,7 +23,6 @@ atmega1284: TARGET = atmega1284p
atmega1284: MCU_TARGET = atmega1284p
atmega1284: CFLAGS += $(COMMON_OPTIONS) -DBIGBOOT
atmega1284: AVR_FREQ ?= 16000000L
atmega1284: LDSECTIONS = -Wl,--section-start=.text=0x1fc00 -Wl,--section-start=.version=0x1fffe
atmega1284: CFLAGS += $(UART_CMD)
atmega1284: $(PROGRAM)_atmega1284p.hex
ifndef PRODUCTION

View File

@ -12,7 +12,6 @@ atmega2560: TARGET = atmega2560
atmega2560: MCU_TARGET = atmega2560
atmega2560: CFLAGS += $(COMMON_OPTIONS) -DBIGBOOT
atmega2560: AVR_FREQ ?= 16000000L
atmega2560: LDSECTIONS = -Wl,--section-start=.text=0x3fc00 -Wl,--section-start=.version=0x3fffe
atmega2560: CFLAGS += $(UART_CMD)
atmega2560: $(PROGRAM)_atmega2560.hex
ifndef PRODUCTION

View File

@ -19,7 +19,6 @@ atmega88: TARGET = atmega88
atmega88: MCU_TARGET = atmega88
atmega88: CFLAGS += $(COMMON_OPTIONS)
atmega88: AVR_FREQ ?= 16000000L
atmega88: LDSECTIONS = -Wl,--section-start=.text=0x1e00 -Wl,--section-start=.version=0x1ffe -Wl,--gc-sections -Wl,--undefined=optiboot_version
atmega88: $(PROGRAM)_atmega88.hex
atmega88: $(PROGRAM)_atmega88.lst
@ -82,7 +81,6 @@ atmega32: TARGET = atmega32
atmega32: MCU_TARGET = atmega32
atmega32: CFLAGS += $(COMMON_OPTIONS)
atmega32: AVR_FREQ ?= 11059200L
atmega32: LDSECTIONS = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
atmega32: $(PROGRAM)_atmega32.hex
atmega32: $(PROGRAM)_atmega32.lst
@ -100,7 +98,6 @@ HELPTEXT += "target atmega128rfa1 - ATmega128RFA1 (100pin, 128k)\n"
atmega128rfa1: MCU_TARGET = atmega128rfa1
atmega128rfa1: CFLAGS += $(COMMON_OPTIONS) -DBIGBOOT $(UART_CMD)
atmega128rfa1: AVR_FREQ ?= 16000000L
atmega128rfa1: LDSECTIONS = -Wl,--section-start=.text=0x1fc00 -Wl,--section-start=.version=0x1fffe
atmega128rfa1: $(PROGRAM)_atmega128rfa1.hex
ifndef PRODUCTION
atmega128rfa1: $(PROGRAM)_atmega128rfa1.lst

View File

@ -25,7 +25,6 @@ atmega16: TARGET = atmega16
atmega16: MCU_TARGET = atmega16
atmega16: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega16: AVR_FREQ ?= 16000000L
atmega16: LDSECTIONS = -Wl,--section-start=.text=0x3e00 -Wl,--section-start=.version=0x3ffe
atmega16: $(PROGRAM)_atmega16_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega16: $(PROGRAM)_atmega16_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -37,7 +36,6 @@ atmega64: TARGET = atmega64
atmega64: MCU_TARGET = atmega64
atmega64: CFLAGS += $(COMMON_OPTIONS) -DBIGBOOT $(UART_CMD)
atmega64: AVR_FREQ ?= 16000000L
atmega64: LDSECTIONS = -Wl,--section-start=.text=0xfc00 -Wl,--section-start=.version=0xfffe
atmega64: $(PROGRAM)_atmega64_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega64: $(PROGRAM)_atmega64_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -49,7 +47,6 @@ atmega88p: TARGET = atmega88p
atmega88p: MCU_TARGET = atmega88p
atmega88p: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega88p: AVR_FREQ ?= 16000000L
atmega88p: LDSECTIONS = -Wl,--section-start=.text=0x1e00 -Wl,--section-start=.version=0x1ffe -Wl,--gc-sections -Wl,--undefined=optiboot_version
atmega88p: $(PROGRAM)_atmega88p_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega88p: $(PROGRAM)_atmega88p_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -61,7 +58,6 @@ atmega88pb: TARGET = atmega88pb
atmega88pb: MCU_TARGET = atmega88pb
atmega88pb: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega88pb: AVR_FREQ ?= 16000000L
atmega88pb: LDSECTIONS = -Wl,--section-start=.text=0x1e00 -Wl,--section-start=.version=0x1ffe -Wl,--gc-sections -Wl,--undefined=optiboot_version
atmega88pb: $(PROGRAM)_atmega88pb_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega88pb: $(PROGRAM)_atmega88pb_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -72,7 +68,6 @@ atmega128: TARGET = atmega128
atmega128: MCU_TARGET = atmega128
atmega128: CFLAGS += $(COMMON_OPTIONS) -DBIGBOOT $(UART_CMD)
atmega128: AVR_FREQ ?= 16000000L
atmega128: LDSECTIONS = -Wl,--section-start=.text=0x1fc00 -Wl,--section-start=.version=0x1fffe
atmega128: $(PROGRAM)_atmega128_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega128: $(PROGRAM)_atmega128_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -84,7 +79,6 @@ atmega162: TARGET = atmega162
atmega162: MCU_TARGET = atmega162
atmega162: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega162: AVR_FREQ ?= 16000000L
atmega162: LDSECTIONS = -Wl,--section-start=.text=0x3e00 -Wl,--section-start=.version=0x3ffe
atmega162: $(PROGRAM)_atmega162_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega162: $(PROGRAM)_atmega162_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -95,7 +89,6 @@ atmega164a: TARGET = atmega164a
atmega164a: MCU_TARGET = atmega164a
atmega164a: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega164a: AVR_FREQ ?= 16000000L
atmega164a: LDSECTIONS = -Wl,--section-start=.text=0x3e00 -Wl,--section-start=.version=0x3ffe
atmega164a: $(PROGRAM)_atmega164a_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega164a: $(PROGRAM)_atmega164a_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -107,7 +100,6 @@ atmega164p: TARGET = atmega164p
atmega164p: MCU_TARGET = atmega164p
atmega164p: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega164p: AVR_FREQ ?= 16000000L
atmega164p: LDSECTIONS = -Wl,--section-start=.text=0x3e00 -Wl,--section-start=.version=0x3ffe
atmega164p: $(PROGRAM)_atmega164p_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega164p: $(PROGRAM)_atmega164p_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -119,7 +111,6 @@ atmega164pa: atmega164p
#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
@ -131,7 +122,6 @@ atmega168p: TARGET = atmega168p
atmega168p: MCU_TARGET = atmega168p
atmega168p: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega168p: AVR_FREQ ?= 16000000L
atmega168p: LDSECTIONS = -Wl,--section-start=.text=0x3e00 -Wl,--section-start=.version=0x3ffe
atmega168p: $(PROGRAM)_atmega168p_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega168p: $(PROGRAM)_atmega168p_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -143,7 +133,6 @@ atmega168pb: TARGET = atmega168pb
atmega168pb: MCU_TARGET = atmega168pb
atmega168pb: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega168pb: AVR_FREQ ?= 16000000L
atmega168pb: LDSECTIONS = -Wl,--section-start=.text=0x3e00 -Wl,--section-start=.version=0x3ffe
atmega168pb: $(PROGRAM)_atmega168pb_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega168pb: $(PROGRAM)_atmega168pb_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -154,7 +143,6 @@ atmega169: TARGET = atmega169
atmega169: MCU_TARGET = atmega169
atmega169: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega169: AVR_FREQ ?= 16000000L
atmega169: LDSECTIONS = -Wl,--section-start=.text=0x3e00 -Wl,--section-start=.version=0x3ffe
atmega169: $(PROGRAM)_atmega169_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega169: $(PROGRAM)_atmega169_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -166,7 +154,6 @@ atmega169p: TARGET = atmega169p
atmega169p: MCU_TARGET = atmega169p
atmega169p: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega169p: AVR_FREQ ?= 16000000L
atmega169p: LDSECTIONS = -Wl,--section-start=.text=0x3e00 -Wl,--section-start=.version=0x3ffe
atmega169p: $(PROGRAM)_atmega169p_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega169p: $(PROGRAM)_atmega169p_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -178,7 +165,6 @@ atmega324a: TARGET = atmega324a
atmega324a: MCU_TARGET = atmega324a
atmega324a: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega324a: AVR_FREQ ?= 16000000L
atmega324a: LDSECTIONS = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
atmega324a: $(PROGRAM)_atmega324a_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega324a: $(PROGRAM)_atmega324a_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -190,7 +176,6 @@ atmega324p: TARGET = atmega324p
atmega324p: MCU_TARGET = atmega324p
atmega324p: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega324p: AVR_FREQ ?= 16000000L
atmega324p: LDSECTIONS = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
atmega324p: $(PROGRAM)_atmega324p_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega324p: $(PROGRAM)_atmega324p_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -201,7 +186,6 @@ atmega324pa: TARGET = atmega324pa
atmega324pa: MCU_TARGET = atmega324pa
atmega324pa: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega324pa: AVR_FREQ ?= 16000000L
atmega324pa: LDSECTIONS = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
atmega324pa: $(PROGRAM)_atmega324pa_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega324pa: $(PROGRAM)_atmega324pa_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -212,7 +196,6 @@ atmega324pb: TARGET = atmega324pb
atmega324pb: MCU_TARGET = atmega324pb
atmega324pb: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega324pb: AVR_FREQ ?= 16000000L
atmega324pb: LDSECTIONS = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
atmega324pb: $(PROGRAM)_atmega324pb_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega324pb: $(PROGRAM)_atmega324pb_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -223,7 +206,6 @@ atmega328pb: TARGET = atmega328pb
atmega328pb: MCU_TARGET = atmega328pb
atmega328pb: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega328pb: AVR_FREQ ?= 16000000L
atmega328pb: LDSECTIONS = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
atmega328pb: $(PROGRAM)_atmega328pb_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega328pb: $(PROGRAM)_atmega328pb_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -234,7 +216,6 @@ atmega329: TARGET = atmega329
atmega329: MCU_TARGET = atmega329
atmega329: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega329: AVR_FREQ ?= 16000000L
atmega329: LDSECTIONS = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
atmega329: $(PROGRAM)_atmega329_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega329: $(PROGRAM)_atmega329_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -246,7 +227,6 @@ atmega329p: TARGET = atmega329p
atmega329p: MCU_TARGET = atmega329p
atmega329p: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega329p: AVR_FREQ ?= 16000000L
atmega329p: LDSECTIONS = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
atmega329p: $(PROGRAM)_atmega329p_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega329p: $(PROGRAM)_atmega329p_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -258,7 +238,6 @@ atmega640: TARGET = atmega640
atmega640: MCU_TARGET = atmega640
atmega640: CFLAGS += $(COMMON_OPTIONS) -DBIGBOOT $(UART_CMD)
atmega640: AVR_FREQ ?= 16000000L
atmega640: LDSECTIONS = -Wl,--section-start=.text=0xfc00 -Wl,--section-start=.version=0xfffe
atmega640: $(PROGRAM)_atmega640_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega640: $(PROGRAM)_atmega640_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -269,7 +248,6 @@ atmega649: TARGET = atmega649
atmega649: MCU_TARGET = atmega649
atmega649: CFLAGS += $(COMMON_OPTIONS) -DBIGBOOT $(UART_CMD)
atmega649: AVR_FREQ ?= 16000000L
atmega649: LDSECTIONS = -Wl,--section-start=.text=0xfc00 -Wl,--section-start=.version=0xfffe
atmega649: $(PROGRAM)_atmega649_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega649: $(PROGRAM)_atmega649_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -280,7 +258,6 @@ atmega649p: TARGET = atmega649p
atmega649p: MCU_TARGET = atmega649p
atmega649p: CFLAGS += $(COMMON_OPTIONS) -DBIGBOOT $(UART_CMD)
atmega649p: AVR_FREQ ?= 16000000L
atmega649p: LDSECTIONS = -Wl,--section-start=.text=0xfc00 -Wl,--section-start=.version=0xfffe
atmega649p: $(PROGRAM)_atmega649p_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega649p: $(PROGRAM)_atmega649p_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -291,7 +268,6 @@ atmega1281: TARGET = atmega1281
atmega1281: MCU_TARGET = atmega1281
atmega1281: CFLAGS += $(COMMON_OPTIONS) -DBIGBOOT $(UART_CMD)
atmega1281: AVR_FREQ ?= 16000000L
atmega1281: LDSECTIONS = -Wl,--section-start=.text=0x1fc00 -Wl,--section-start=.version=0x1fffe
atmega1281: $(PROGRAM)_atmega1281_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega1281: $(PROGRAM)_atmega1281_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -302,7 +278,6 @@ atmega2561: TARGET = atmega2561
atmega2561: MCU_TARGET = atmega2561
atmega2561: CFLAGS += $(COMMON_OPTIONS) -DBIGBOOT $(UART_CMD)
atmega2561: AVR_FREQ ?= 16000000L
atmega2561: LDSECTIONS = -Wl,--section-start=.text=0x3fc00 -Wl,--section-start=.version=0x3fffe
atmega2561: $(PROGRAM)_atmega2561_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega2561: $(PROGRAM)_atmega2561_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -313,7 +288,6 @@ atmega3290: TARGET = atmega3290
atmega3290: MCU_TARGET = atmega3290
atmega3290: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega3290: AVR_FREQ ?= 16000000L
atmega3290: LDSECTIONS = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
atmega3290: $(PROGRAM)_atmega3290_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega3290: $(PROGRAM)_atmega3290_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -324,7 +298,6 @@ atmega3290p: TARGET = atmega3290p
atmega3290p: MCU_TARGET = atmega3290p
atmega3290p: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega3290p: AVR_FREQ ?= 16000000L
atmega3290p: LDSECTIONS = -Wl,--section-start=.text=0x7e00 -Wl,--section-start=.version=0x7ffe
atmega3290p: $(PROGRAM)_atmega3290p_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega3290p: $(PROGRAM)_atmega3290p_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -336,7 +309,6 @@ atmega6490: TARGET = atmega6490
atmega6490: MCU_TARGET = atmega6490
atmega6490: CFLAGS += $(COMMON_OPTIONS) -DBIGBOOT $(UART_CMD)
atmega6490: AVR_FREQ ?= 16000000L
atmega6490: LDSECTIONS = -Wl,--section-start=.text=0xfc00 -Wl,--section-start=.version=0xfffe
atmega6490: $(PROGRAM)_atmega6490_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega6490: $(PROGRAM)_atmega6490_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -347,7 +319,6 @@ atmega6490p: TARGET = atmega6490p
atmega6490p: MCU_TARGET = atmega6490p
atmega6490p: CFLAGS += $(COMMON_OPTIONS) -DBIGBOOT $(UART_CMD)
atmega6490p: AVR_FREQ ?= 16000000L
atmega6490p: LDSECTIONS = -Wl,--section-start=.text=0xfc00 -Wl,--section-start=.version=0xfffe
atmega6490p: $(PROGRAM)_atmega6490p_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega6490p: $(PROGRAM)_atmega6490p_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -358,7 +329,6 @@ atmega8515: TARGET = atmega8515
atmega8515: MCU_TARGET = atmega8515
atmega8515: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega8515: AVR_FREQ ?= 16000000L
atmega8515: LDSECTIONS = -Wl,--section-start=.text=0x1e00 -Wl,--section-start=.version=0x1ffe
atmega8515: $(PROGRAM)_atmega8515_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega8515: $(PROGRAM)_atmega8515_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst
@ -369,7 +339,6 @@ atmega8535: TARGET := atmega8535
atmega8535: MCU_TARGET = atmega8535
atmega8535: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
atmega8535: AVR_FREQ ?= 16000000L
atmega8535: LDSECTIONS = -Wl,--section-start=.text=0x1e00 -Wl,--section-start=.version=0x1ffe
atmega8535: $(PROGRAM)_atmega8535_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).hex
ifndef PRODUCTION
atmega8535: $(PROGRAM)_atmega8535_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ).lst

View File

@ -10,7 +10,6 @@ attiny1634: MCU_TARGET = attiny1634
attiny1634: LED_CMD ?= -DLED=C0
attiny1634: CFLAGS += $(COMMON_OPTIONS) -DVIRTUAL_BOOT_PARTITION -DFOURPAGEERASE $(UART_CMD)
attiny1634: AVR_FREQ ?= 8000000L
attiny1634: LDSECTIONS = -Wl,--section-start=.text=0x3d80 -Wl,--section-start=.version=0x3ffe
attiny1634: $(PROGRAM)_attiny1634.hex
ifndef PRODUCTION
attiny1634: $(PROGRAM)_attiny1634.lst
@ -178,7 +177,6 @@ attiny841: TARGET = attiny841
attiny841: MCU_TARGET = attiny841
attiny841: CFLAGS += $(COMMON_OPTIONS) '-DVIRTUAL_BOOT_PARTITION' '-DFOURPAGEERASE' $(UART_CMD)
attiny841: AVR_FREQ ?= 8000000L
attiny841: LDSECTIONS = -Wl,--section-start=.text=0x1d80 -Wl,--section-start=.version=0x1ffe
attiny841: $(PROGRAM)_attiny841.hex
ifndef PRODUCTION
attiny841: $(PROGRAM)_attiny841.lst
@ -363,21 +361,21 @@ endif
#-----------------------
attiny841at20noLED:
$(MAKE) attiny841 AVR_FREQ=20000000L LED_START_FLASHES=0 LDSECTIONS = -Wl,--section-start=.text=0x1dc0 -Wl,--section-start=.version=0x1ffe
$(MAKE) attiny841 AVR_FREQ=20000000L LED_START_FLASHES=0
mv $(PROGRAM)_attiny841.hex $(PROGRAM)_attiny841_20000000L_noLED.hex
ifndef PRODUCTION
mv $(PROGRAM)_attiny841.lst $(PROGRAM)_attiny841_20000000L_noLED.lst
endif
attiny841at16noLED:
$(MAKE) attiny841 AVR_FREQ=16000000L LED_START_FLASHES=0 LDSECTIONS = -Wl,--section-start=.text=0x1dc0 -Wl,--section-start=.version=0x1ffe
$(MAKE) attiny841 AVR_FREQ=16000000L LED_START_FLASHES=0
mv $(PROGRAM)_attiny841.hex $(PROGRAM)_attiny841_16000000L_noLED.hex
ifndef PRODUCTION
mv $(PROGRAM)_attiny841.lst $(PROGRAM)_attiny841_16000000L_noLED.lst
endif
attiny841at8noLED:
$(MAKE) attiny841 AVR_FREQ=8000000L BAUD_RATE=57600 LED_START_FLASHES=0 LDSECTIONS = -Wl,--section-start=.text=0x1dc0 -Wl,--section-start=.version=0x1ffe
$(MAKE) attiny841 AVR_FREQ=8000000L BAUD_RATE=57600 LED_START_FLASHES=0
mv $(PROGRAM)_attiny841.hex $(PROGRAM)_attiny841_8000000L_noLED.hex
ifndef PRODUCTION
mv $(PROGRAM)_attiny841.lst $(PROGRAM)_attiny841_8000000L_noLED.lst
@ -395,7 +393,6 @@ attiny441: TARGET = attiny441
attiny441: MCU_TARGET = attiny441
attiny441: CFLAGS += $(COMMON_OPTIONS) '-DVIRTUAL_BOOT_PARTITION' '-DFOURPAGEERASE' $(UART_CMD)
attiny441: AVR_FREQ ?= 8000000L
attiny441: LDSECTIONS = -Wl,--section-start=.text=0x0d80 -Wl,--section-start=.version=0x0ffe
attiny441: $(PROGRAM)_attiny441.hex
ifndef PRODUCTION
attiny441: $(PROGRAM)_attiny441.lst
@ -586,21 +583,21 @@ endif
#-----------------------
attiny441at20noLED:
$(MAKE) attiny441 AVR_FREQ=20000000L LED_START_FLASHES=0 LDSECTIONS = -Wl,--section-start=.text=0x0dc0 -Wl,--section-start=.version=0x0ffe
$(MAKE) attiny441 AVR_FREQ=20000000L LED_START_FLASHES=0
mv $(PROGRAM)_attiny441.hex $(PROGRAM)_attiny441_20000000L_noLED.hex
ifndef PRODUCTION
mv $(PROGRAM)_attiny441.lst $(PROGRAM)_attiny441_20000000L_noLED.lst
endif
attiny441at16noLED:
$(MAKE) attiny441 AVR_FREQ=16000000L LED_START_FLASHES=0 LDSECTIONS = -Wl,--section-start=.text=0x0dc0 -Wl,--section-start=.version=0x0ffe
$(MAKE) attiny441 AVR_FREQ=16000000L LED_START_FLASHES=0
mv $(PROGRAM)_attiny441.hex $(PROGRAM)_attiny441_16000000L_noLED.hex
ifndef PRODUCTION
mv $(PROGRAM)_attiny441.lst $(PROGRAM)_attiny441_16000000L_noLED.lst
endif
attiny441at8noLED:
$(MAKE) attiny441 AVR_FREQ=8000000L BAUD_RATE=57600 LED_START_FLASHES=0 LDSECTIONS = -Wl,--section-start=.text=0x0dc0 -Wl,--section-start=.version=0x0ffe
$(MAKE) attiny441 AVR_FREQ=8000000L BAUD_RATE=57600 LED_START_FLASHES=0
mv $(PROGRAM)_attiny441.hex $(PROGRAM)_attiny441_8000000L_noLED.hex
ifndef PRODUCTION
mv $(PROGRAM)_attiny441.lst $(PROGRAM)_attiny441_8000000L_noLED.lst
@ -617,7 +614,6 @@ attiny828: TARGET = attiny828
attiny828: MCU_TARGET = attiny828
attiny828: CFLAGS += $(COMMON_OPTIONS)
attiny828: AVR_FREQ ?= 8000000L
attiny828: LDSECTIONS = -Wl,--section-start=.text=0x1E00 -Wl,--section-start=.version=0x1ffe
attiny828: $(PROGRAM)_attiny828.hex
ifndef PRODUCTION
attiny828: $(PROGRAM)_attiny828.lst
@ -683,7 +679,6 @@ attiny88: TARGET = attiny88
attiny88: MCU_TARGET = attiny88
attiny88: CFLAGS += $(COMMON_OPTIONS) '-DVIRTUAL_BOOT_PARTITION' '-DSOFT_UART'
attiny88: AVR_FREQ ?= 8000000L
attiny88: LDSECTIONS = -Wl,--section-start=.text=0x1D80 -Wl,--section-start=.version=0x1ffe
attiny88: $(PROGRAM)_attiny88.hex
ifndef PRODUCTION
attiny88: $(PROGRAM)_attiny88.lst
@ -750,7 +745,6 @@ attiny48: TARGET = attiny48
attiny48: MCU_TARGET = attiny48
attiny48: CFLAGS += $(COMMON_OPTIONS) '-DVIRTUAL_BOOT_PARTITION' '-DSOFT_UART'
attiny48: AVR_FREQ ?= 8000000L
attiny48: LDSECTIONS = -Wl,--section-start=.text=0x0D80 -Wl,--section-start=.version=0x0ffe
attiny48: $(PROGRAM)_attiny48.hex
ifndef PRODUCTION
attiny48: $(PROGRAM)_attiny48.lst
@ -817,7 +811,6 @@ attiny85: MCU_TARGET = attiny85
attiny85: LED_START_FLASHES_CMD = '-DLED_START_FLASHES=0'
attiny85: CFLAGS += $(COMMON_OPTIONS) '-DVIRTUAL_BOOT_PARTITION' '-DSOFT_UART'
attiny85: AVR_FREQ ?= 8000000L
attiny85: LDSECTIONS = -Wl,--section-start=.text=0x1DC0 -Wl,--section-start=.version=0x1ffe
attiny85: $(PROGRAM)_attiny85.hex
ifndef PRODUCTION
attiny85: $(PROGRAM)_attiny85.lst
@ -904,7 +897,6 @@ attiny45: MCU_TARGET = attiny45
attiny45: LED_START_FLASHES_CMD = '-DLED_START_FLASHES=0'
attiny45: CFLAGS += $(COMMON_OPTIONS) '-DVIRTUAL_BOOT_PARTITION' '-DSOFT_UART'
attiny45: AVR_FREQ ?= 8000000L
attiny45: LDSECTIONS = -Wl,--section-start=.text=0x0DC0 -Wl,--section-start=.version=0x0ffe
attiny45: $(PROGRAM)_attiny45.hex
ifndef PRODUCTION
attiny45: $(PROGRAM)_attiny45.lst
@ -991,7 +983,6 @@ attiny84: TARGET = attiny84
attiny84: MCU_TARGET = attiny84
attiny84: CFLAGS += $(COMMON_OPTIONS) '-DVIRTUAL_BOOT_PARTITION' '-DSOFT_UART'
attiny84: AVR_FREQ ?= 8000000L
attiny84: LDSECTIONS = -Wl,--section-start=.text=0x1D80 -Wl,--section-start=.version=0x1ffe
attiny84: $(PROGRAM)_attiny84.hex
ifndef PRODUCTION
attiny84: $(PROGRAM)_attiny84.lst
@ -1078,7 +1069,6 @@ attiny44: TARGET = attiny44
attiny44: MCU_TARGET = attiny44
attiny44: CFLAGS += $(COMMON_OPTIONS) '-DVIRTUAL_BOOT_PARTITION' '-DSOFT_UART'
attiny44: AVR_FREQ ?= 8000000L
attiny44: LDSECTIONS = -Wl,--section-start=.text=0x0D80 -Wl,--section-start=.version=0x0ffe
attiny44: $(PROGRAM)_attiny44.hex
ifndef PRODUCTION
attiny44: $(PROGRAM)_attiny44.lst
@ -1166,7 +1156,6 @@ attiny861: TARGET = attiny861
attiny861: MCU_TARGET = attiny861
attiny861: CFLAGS += $(COMMON_OPTIONS) '-DVIRTUAL_BOOT_PARTITION' '-DSOFT_UART'
attiny861: AVR_FREQ ?= 8000000L
attiny861: LDSECTIONS = -Wl,--section-start=.text=0x1D80 -Wl,--section-start=.version=0x1ffe
attiny861: $(PROGRAM)_attiny861.hex
ifndef PRODUCTION
attiny861: $(PROGRAM)_attiny861.lst
@ -1253,7 +1242,6 @@ attiny461: TARGET = attiny461
attiny461: MCU_TARGET = attiny461
attiny461: CFLAGS += $(COMMON_OPTIONS) '-DVIRTUAL_BOOT_PARTITION' '-DSOFT_UART'
attiny461: AVR_FREQ ?= 8000000L
attiny461: LDSECTIONS = -Wl,--section-start=.text=0x0D80 -Wl,--section-start=.version=0x0ffe
attiny461: $(PROGRAM)_attiny461.hex
ifndef PRODUCTION
attiny461: $(PROGRAM)_attiny461.lst
@ -1341,7 +1329,6 @@ attiny167: TARGET = attiny167
attiny167: MCU_TARGET = attiny167
attiny167: AVR_FREQ ?= 8000000L
attiny167: CFLAGS += $(COMMON_OPTIONS) '-DVIRTUAL_BOOT_PARTITION'
attiny167: LDSECTIONS = -Wl,--section-start=.text=0x3d80 -Wl,--section-start=.version=0x3ffe
attiny167: $(PROGRAM)_attiny167.hex
ifndef PRODUCTION
attiny167: $(PROGRAM)_attiny167.lst
@ -1352,7 +1339,6 @@ attiny87: TARGET = attiny87
attiny87: MCU_TARGET = attiny87
attiny87: CFLAGS += $(COMMON_OPTIONS) '-DVIRTUAL_BOOT_PARTITION'
attiny87: AVR_FREQ ?= 8000000L
attiny87: LDSECTIONS = -Wl,--section-start=.text=0x1d80 -Wl,--section-start=.version=0x1ffe
attiny87: $(PROGRAM)_attiny87.hex
ifndef PRODUCTION
attiny87: $(PROGRAM)_attiny87.lst

View File

@ -23,11 +23,6 @@ atmega8u2atUART: TARGET = atmega8u2
atmega8u2atUART: MCU_TARGET = atmega8u2
atmega8u2atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
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)_BB$(BIGBOOT).hex
ifndef PRODUCTION
atmega8u2atUART: $(PROGRAM)_atmega8u2_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).lst
@ -57,11 +52,6 @@ atmega16u2atUART: TARGET = atmega16u2
atmega16u2atUART: MCU_TARGET = atmega16u2
atmega16u2atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
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)_BB$(BIGBOOT).hex
ifndef PRODUCTION
atmega16u2atUART: $(PROGRAM)_atmega16u2_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).lst
@ -91,11 +81,6 @@ atmega32u2atUART: TARGET = atmega32u2
atmega32u2atUART: MCU_TARGET = atmega32u2
atmega32u2atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
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)_BB$(BIGBOOT).hex
ifndef PRODUCTION
atmega32u2atUART: $(PROGRAM)_atmega32u2_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).lst
@ -125,11 +110,6 @@ atmega16u4atUART: TARGET = atmega16u4
atmega16u4atUART: MCU_TARGET = atmega16u4
atmega16u4atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
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)_BB$(BIGBOOT).hex
ifndef PRODUCTION
atmega16u4atUART: $(PROGRAM)_atmega16u4_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).lst
@ -160,11 +140,6 @@ atmega32u4atUART: TARGET = atmega32u4
atmega32u4atUART: MCU_TARGET = atmega32u4
atmega32u4atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
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)_BB$(BIGBOOT).hex
ifndef PRODUCTION
atmega32u4atUART: $(PROGRAM)_atmega32u4_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).lst
@ -195,11 +170,6 @@ atmega32u6atUART: TARGET = atmega32u6
atmega32u6atUART: MCU_TARGET = atmega32u6
atmega32u6atUART: CFLAGS += $(COMMON_OPTIONS) $(UART_CMD)
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)_BB$(BIGBOOT).hex
ifndef PRODUCTION
atmega32u6atUART: $(PROGRAM)_atmega32u6_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).lst
@ -229,11 +199,6 @@ 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)_BB$(BIGBOOT).hex
ifndef PRODUCTION
at90usb646atUART: $(PROGRAM)_at90usb646_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).lst
@ -244,11 +209,7 @@ at90usb646:
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
@ -263,11 +224,6 @@ 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)_BB$(BIGBOOT).hex
ifndef PRODUCTION
at90usb647atUART: $(PROGRAM)_at90usb647_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).lst
@ -278,11 +234,7 @@ at90usb647:
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
@ -297,11 +249,6 @@ 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)_BB$(BIGBOOT).hex
ifndef PRODUCTION
at90usb1286atUART: $(PROGRAM)_at90usb1286_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).lst
@ -312,11 +259,7 @@ at90usb1286:
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
@ -331,11 +274,6 @@ 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: $(PROGRAM)_at90usb1287_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).hex
ifndef PRODUCTION
at90usb1287atUART: $(PROGRAM)_at90usb1287_UART$(UART)_$(BAUD_RATE)_$(AVR_FREQ)_BB$(BIGBOOT).lst
@ -346,11 +284,7 @@ at90usb1287:
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

View File

@ -0,0 +1,145 @@
/* Customized Linker script for Optiboot */
/* Copyright (C) 2014-2015 Free Software Foundation, Inc.
Copyright (C) 2021 by William Westfield
Copying and distribution of this script, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
*/
/*
* this is based off of the default ATmega328 linker script, but it
* has been generalized (since optiboot makes little use of the standard
* chip-specific values), and also specialized to based start addresses
* of the code on symbols passed from the C program, instead of needing
* --section-start commands in the linker command line.
* (The C program does this by using asm() statements to define absolute
* symbols that the linker can see.
* The .data and .bss segments are removed, since the bootloader must not
* use them (and does its own memory management) (this has the added
* "benefit" of spitting out error messages if the code DOES try to
* use data or bss variables.
*/
OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr")
__FUSE_REGION_LENGTH__ = DEFINED(__FUSE_REGION_LENGTH__) ? __FUSE_REGION_LENGTH__ : 1K;
/* This makes the disassembly listings prettier */
__RAM__ = 0x800000;
MEMORY
{
text (rx) : ORIGIN = __BOOT_START__, LENGTH = __BOOT_SIZE__
version (rx) : ORIGIN = __VERSION_START__, LENGTH = 2
fuse (rw!x) : ORIGIN = 0x820000, LENGTH = __FUSE_REGION_LENGTH__
}
SECTIONS
{
/* Read-only sections, merged into text segment: */
/* Internal text space or external memory. */
.text :
{
*(.vectors)
KEEP(*(.vectors))
/* For data that needs to reside in the lower 64k of progmem. */
*(.progmem.gcc*)
/* PR 13812: Placing the trampolines here gives a better chance
that they will be in range of the code that uses them. */
. = ALIGN(2);
*(.init0) /* Start here after reset. */
KEEP (*(.init0))
*(.init1)
KEEP (*(.init1))
*(.init2) /* Clear __zero_reg__, set up stack pointer. */
KEEP (*(.init2))
*(.init3)
KEEP (*(.init3))
*(.init4) /* Initialize data and BSS. */
KEEP (*(.init4))
*(.init5)
KEEP (*(.init5))
*(.init6) /* C++ constructors. */
KEEP (*(.init6))
*(.init7)
KEEP (*(.init7))
*(.init8)
KEEP (*(.init8))
*(.init9) /* Call main(). */
KEEP (*(.init9))
*(.text)
. = ALIGN(2);
*(.text.*)
. = ALIGN(2);
*(.fini9) /* _exit() starts here. */
KEEP (*(.fini9))
*(.fini8)
KEEP (*(.fini8))
*(.fini7)
KEEP (*(.fini7))
*(.fini6) /* C++ destructors. */
KEEP (*(.fini6))
*(.fini5)
KEEP (*(.fini5))
*(.fini4)
KEEP (*(.fini4))
*(.fini3)
KEEP (*(.fini3))
*(.fini2)
KEEP (*(.fini2))
*(.fini1)
KEEP (*(.fini1))
*(.fini0) /* Infinite loop after program termination. */
KEEP (*(.fini0))
_etext = . ;
} > text
.version __VERSION_START__ :
{
*(.version)
} > text
.fuse :
{
KEEP(*(.fuse))
KEEP(*(.lfuse))
KEEP(*(.hfuse))
KEEP(*(.efuse))
} > fuse
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
.note.gnu.build-id : { *(.note.gnu.build-id) }
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/* DWARF 3 */
.debug_pubtypes 0 : { *(.debug_pubtypes) }
.debug_ranges 0 : { *(.debug_ranges) }
/* DWARF Extension. */
.debug_macro 0 : { *(.debug_macro) }
}

View File

@ -0,0 +1,115 @@
#
# Makefile to make one image for each chip that optiboot supports.
# includes Arduino, Spence Konde ATtinyCore, Hans MCUDude cores, and
# some others.
# this is mainly used to sanity check modifications, especially those
# that are expected to cause "no binary changes" (you can diff the
# resulting .hex file with a reference implementation.)
#
make clean
#Attinycore
make attiny841at16
make attiny841at16ser1
make attiny441at16
make attiny441at16ser1
make attiny87at16
make attiny167at16
make attiny1634at16
make attiny1634at16ser1
make attiny828at16
make attiny88at16
make attiny48at16
make attiny85at16
make attiny45at16
make attiny84at16
make attiny44at16
make attiny861at16
make attiny461at16
# mega
make mega2560
make mega1280
# usb
make atmega8u2 LED=D5 LED_START_FLASHES=2 UART=1
make atmega16u2 LED=D5 LED_START_FLASHES=2 UART=1
make atmega32u2 LED=D5 LED_START_FLASHES=2 UART=1
make atmega16u4 LED=C7 LED_START_FLASHES=0 UART=1
make atmega32u4 LED=C7 LED_START_FLASHES=0 UART=1
make atmega32u6 LED=C6 LED_START_FLASHES=2 UART=1
make at90usb646 LED=C6 LED_START_FLASHES=2 UART=1 NODATE=1 BIGBOOT=1
make at90usb647 LED=C6 LED_START_FLASHES=2 UART=1 NODATE=1 BIGBOOT=1
make at90usb1286 LED=C6 LED_START_FLASHES=2 UART=1 NODATE=1 BIGBOOT=1
make at90usb1287 LED=C6 LED_START_FLASHES=2 UART=1 NODATE=1 BIGBOOT=1
# buildable platforms of somewhat questionable support level
make lilypad
make pro8
make pro16
make pro20
make atmega328_pro8
make sanguino
make mega1280
make luminet
make diecimila
make bobuino
make wildfirev2
make atmega1284
make atmega32
make atmega168p
# Atmel development board targets
make xplained168pb
make xplained328p
make xplained328pb
# mcudude cores
make atmega8 LED=B5 LED_START_FLASHES=2 UART=0
make atmega16 LED=B0 LED_START_FLASHES=2 UART=0
make atmega32 LED=B0 LED_START_FLASHES=2 UART=0
make atmega64 LED=B5 LED_START_FLASHES=2 UART=0 BIGBOOT=1 NODATE=1
make atmega88 LED=B5 LED_START_FLASHES=2 UART=0
make atmega88p LED=B5 LED_START_FLASHES=2 UART=0
make atmega88pb LED=B5 LED_START_FLASHES=2 UART=0
make atmega128 LED=B5 LED_START_FLASHES=2 UART=0 BIGBOOT=1 NODATE=1
make atmega162 LED=B0 LED_START_FLASHES=0 UART=0
make atmega164a LED=B0 LED_START_FLASHES=2 UART=0
make atmega164p LED=B0 LED_START_FLASHES=2 UART=0
make atmega168 LED=B5 LED_START_FLASHES=2 UART=0
make atmega168p LED=B5 LED_START_FLASHES=2 UART=0
make atmega168pb LED=B5 LED_START_FLASHES=2 UART=0
make atmega169 LED=B5 LED_START_FLASHES=2 UART=0
make atmega169p LED=B5 LED_START_FLASHES=2 UART=0
make atmega324a LED=B0 LED_START_FLASHES=2 UART=0
make atmega324p LED=B0 LED_START_FLASHES=2 UART=0
make atmega324pa LED=B0 LED_START_FLASHES=2 UART=0
make atmega324pb LED=B0 LED_START_FLASHES=2 UART=0
make atmega328 LED=B5 LED_START_FLASHES=2 UART=0
make atmega328pb LED=B5 LED_START_FLASHES=2 UART=0
make atmega329 LED=B5 LED_START_FLASHES=2 UART=0
make atmega329p LED=B5 LED_START_FLASHES=2 UART=0
make atmega640 LED=B7 LED_START_FLASHES=2 UART=0 BIGBOOT=1 NODATE=1
make atmega644p LED=B0 LED_START_FLASHES=2 UART=0 BIGBOOT=1 NODATE=1
make atmega649 LED=B5 LED_START_FLASHES=2 UART=0 BIGBOOT=1 NODATE=1
make atmega649p LED=B5 LED_START_FLASHES=2 UART=0 BIGBOOT=1 NODATE=1
make atmega1280 LED=B7 LED_START_FLASHES=2 UART=0 BIGBOOT=1 NODATE=1
make atmega1281 LED=B5 LED_START_FLASHES=2 UART=0 BIGBOOT=1 NODATE=1
make atmega1284 LED=B0 LED_START_FLASHES=2 UART=0 BIGBOOT=1 NODATE=1
make atmega1284p LED=B0 LED_START_FLASHES=2 UART=0 BIGBOOT=1 NODATE=1
make atmega2560 LED=B7 LED_START_FLASHES=2 UART=0 BIGBOOT=1 NODATE=1
make atmega2561 LED=B5 LED_START_FLASHES=2 UART=0 BIGBOOT=1 NODATE=1
make atmega3290 LED=B5 LED_START_FLASHES=2 UART=0
make atmega3290p LED=B5 LED_START_FLASHES=2 UART=0
make atmega6490 LED=B5 LED_START_FLASHES=2 UART=0 BIGBOOT=1 NODATE=1
make atmega6490p LED=B5 LED_START_FLASHES=2 UART=0 BIGBOOT=1 NODATE=1
make atmega8515 LED=B0 LED_START_FLASHES=2 UART=0
make atmega8535 LED=B0 LED_START_FLASHES=2 UART=0
# default generic platforms
# These need to be built AFTER the platforms, or they'll get renamed
make atmega8
make atmega168
make atmega328

View File

@ -239,6 +239,10 @@
/**********************************************************/
/* Edit History: */
/* */
/* Oct 2021 */
/* 8.3 WestfW add section-start determination code to */
/* the C source. In theory, this causes no changes */
/* to the binary, but it's "risky", so ... bump. */
/* Aug 2019 */
/* 8.1 WestfW Fix bug in calculation of Vboot offset */
/* Sep 2018 */
@ -328,7 +332,7 @@
/**********************************************************/
#define OPTIBOOT_MAJVER 8
#define OPTIBOOT_MINVER 2
#define OPTIBOOT_MINVER 3
/*
* OPTIBOOT_CUSTOMVER should be defined (by the makefile) for custom edits
@ -597,6 +601,92 @@ static addr16_t buff = {(uint8_t *)(RAMSTART)};
#endif // VIRTUAL_BOOT_PARTITION
void sectionOpts() __attribute__((naked));
void sectionOpts() {
/*
* Mysterious Magic code to allow section-start addresses to be
* specifed by the C code (which, after all, has access to CPP symbols
* like FLASHEND, and can make a "safer" guess than putting manually
* determined constants in the Makefile. This is dependent on a custom
* linker script that makes use of the __BOOT_ symbols that we define.
* Fortunately, that script can be used to link optiboot on any of its
* usual chips.
*
* with some judicious use of asm directives, we can define symbols
* that the linker will look at for positioning our segments (in
* combination with a custom linker script) based on the flash size
* defined via io.h, instead of requiring magic --section-start
* constants on the build line.
*
* This apparently needs to be inside a function in order to pass
* arguments to the asm command (even though the asm doesn't
* generate any code) But we can make sure the function (which doesn't
* actually contain any code) doesn't actually end up in the binary.
*/
#if BIGBOOT
/*
* BIGBOOT images are easy, because they're much smaller than the
* flash size that they are defined to occupy (1k)
*/
asm(" .global __BOOT_SIZE__, __BOOT_START__, __VERSION_START__\n"
" .equ __BOOT_SIZE__, 1024\n"
" .equ __BOOT_START__, (%0-1023)\n"
" .equ __VERSION_START__, (%0-1)\n"
::"i"((uint32_t)FLASHEND));
#else
/*
* non-BIGBOOT images try to fit in 512bytes, but don't quite fit
* on chips that don't have HW support for a boot section. We try
* to guess how big the extra bits of code are, and then round up
* to the next larger flash page boundry (which can be nearly 4 pages
* away on chips with FOURPAGEERASE)
* These numbers are determined manually by building a reference
* implementation with various options and comparing sizes.
*/
# if VIRTUAL_BOOT_PARTITION
/* VIRTUAL_BOOT_PARTITION code is about 100 bytes */
# define VBSIZE 110
# else
# define VBSIZE 0
# endif
# if LED_START_FLASHES==0
/* if LED_START_FLASHES is 0 (eg on 8pin chips), it saves some code */
# define LEDSIZE (-30)
# else
# define LEDSIZE 0
# endif
# if SOFT_UART
/* But not having a hardware UART costs a bit */
# define SOFTUSIZE 16
# else
# define SOFTUSIZE 0
# endif
# if FOURPAGEERASE
/* FOURPAGEERASE adds some code, and also affects how we round */
# define ERASESIZE 8
# define PAGSIZ_B (SPM_PAGESIZE*4)
# else
# define PAGSIZ_B (SPM_PAGESIZE)
# define ERASESIZE 0
# endif
/*
* Round our guess up to next page size. So 560 byte images occupy 576bytes,
* 600 byte images occupy 640 bytes, etc. Depending on chip.
* Note that SPM_PAGESIZE is already in bytes in the .h files.
*/
# define ROUNDTOPAGE(size) (((size + (PAGSIZ_B/2))/(PAGSIZ_B))*(PAGSIZ_B))
/* use 511 here so we don't round up to the next page on normal systems. */
# define BOOTSIZE (511+ERASESIZE+VBSIZE+SOFTUSIZE+LEDSIZE)
asm(" .global __BOOT_SIZE__, __BOOT_START__, __VERSION_START__\n"
" .equ __BOOT_SIZE__, %1\n"
" .equ __BOOT_START__, ((%0+1)-%1)\n"
" .equ __VERSION_START__, (%0-1)\n"
::"i"((uint32_t)FLASHEND), "i"(ROUNDTOPAGE(BOOTSIZE)));
#endif
/* Wasn't that FUN! */
}
/* everything that needs to run VERY early */
void pre_main(void) {
@ -1566,7 +1656,10 @@ OPT2FLASH(SOFT_UART);
OPT2FLASH(UART);
#endif
#if (!defined(NODATE)) || (NODATE == 0)
// Leave out the date, useful if we want to compare binaries
OPTFLASHSECT const char f_date[] = "Built:" __DATE__ ":" __TIME__;
#endif
#if BIGBOOT
OPT2FLASH(BIGBOOT);
#endif

View File

@ -1,55 +1,54 @@
:020000021000EC
:10FC000001C022C1112484B7882369F0982F9A700B
:10FC000001C01DC1112484B7882369F0982F9A7010
:10FC1000923049F081FF02C097EF94BF282E80E018
:10FC2000FED00C94000085E08093810082E08093F8
:10FC2000F9D00C94000085E08093810082E08093FD
:10FC3000C00088E18093C10086E08093C20080E12B
:10FC40008093C4008EE0EBD0279A86E020E33CEF5F
:10FC40008093C4008EE0E6D0279A86E020E33CEF64
:10FC500091E0309385002093840096BBB09BFECF4B
:10FC60001F9AA8954091C00047FD02C0815089F7B6
:10FC7000FF24F39455E0E52E61E1D62EC4D0813403
:10FC8000C9F4C1D0C82FD1D0C23811F481E010C05E
:10FC9000C13869F488E00CC0843709F482C0853724
:10FCA00009F0A2C0C2D08EE1A7D087E9A5D083E039
:10FCB000A3D09FC0823411F484E103C0853419F4C9
:10FCC00085E0BBD096C0853579F49DD0082F9BD0B8
:10FCD000182F87FF03C08BB7816002C08BB78E7F60
:10FCE0008BBF000F111F84C0863581F48CD08D34FA
:10FCF00049F489D0CBB787D0C170880FC82BCBBF50
:10FD000081E001C083E099D080E0D2CF843609F051
:10FD1000C3CF79D0C82FD0E0DC2FCC2774D0C82B2C
:10FD200072D0C82E5E01812C32E0932E6CD0F4018B
:10FD300081934F01F1E0AF1AB108C1F776D085E4A5
:10FD4000C81212C0DE5F4801A12C92E0B92EAC1699
:10FD5000BD0609F44EC0F50161915F01C4018CD06C
:10FD6000FFEF8F1A9F0AF3CF83E0F80187BFE89572
:10FD700007B600FCFDCFA0E0B2E0F8018D919D91A7
:10FD80000C01F7BEE8951124229732962097B1F71F
:10FD9000F801E7BEE89507B600FCFDCFD7BEE895B1
:10FDA00028C031D0C82FD0E0DC2FCC272CD05E016A
:10FDB000A82A29D0982E39D0E801F5E49F120BC06B
:10FDC000CE0152D019D081E0A81AB1082196A11411
:10FDD000B104B1F70EC0FE018791EF010DD0E1E053
:10FDE000AE1AB108C1F705C0813511F488E017D00B
:10FDF0001CD080E101D042CF9091C00095FFFCCF94
:10FE00008093C60008958091C00087FFFCCF809149
:10FE1000C00084FD01C0A8958091C6000895E0E669
:10FE2000F0E098E1908380830895EDDF803219F04F
:10FE300088E0F5DFFFCF84E1DFCFCF93C82FE3DF8A
:10FE4000C150E9F7CF91F1CFFC010A0167BFE895F6
:10FE5000112407B600FCFDCF667029F0452B19F47C
:10FE600081E187BFE8950895F999FECF92BD81BDE4
:10FE7000F89A992780B50895262FF999FECF1FBAD1
:10FE800092BD81BD20BD0FB6F894FA9AF99A0FBEC3
:10FE90000196089556657273696F6E3D382E310074
:10FEA0004F505449424F4F545F435553544F4D5652
:10FEB00045523D30004465766963653D61746D650A
:10FEC00067613132383000465F4350553D3136303E
:10FED00030303030304C00424947424F4F543D3172
:10FEE000004275696C743A4D6179203239203230A4
:10FEF00032303A30313A30323A343000554152548F
:10FF00003D3000424155445F524154453D31313509
:10FF1000323030004C45443D4237004C45445F533D
:0FFF2000544152545F464C41534845533D3300C2
:02FFFE000108F8
:10FC7000FF24F39455E0E52E61E1D62EBFD0813408
:10FC800049F4BCD0C82FCCD0C13809F0A6C088E058
:10FC9000AED0AAC0823411F484E103C0853419F4D3
:10FCA00085E0C6D0A1C0853579F4A8D0082FA6D0AC
:10FCB000182F87FF03C08BB7816002C08BB78E7F80
:10FCC0008BBF000F111F8FC0863581F497D08D3404
:10FCD00049F494D0CBB792D0C170880FC82BCBBF5A
:10FCE00081E001C083E0A4D080E0D2CF843609F067
:10FCF00048C084D0C82FD0E0DC2FCC277FD0C82BC1
:10FD00007DD0C82E5E01812C32E0932E77D0F40195
:10FD100081934F01F1E0AF1AB108C1F781D085E4BA
:10FD2000C81212C0DE5F4801A12C92E0B92EAC16B9
:10FD3000BD0609F459C0F50161915F01C40197D076
:10FD4000FFEF8F1A9F0AF3CF83E0F80187BFE89592
:10FD500007B600FCFDCFA0E0B2E0F8018D919D91C7
:10FD60000C01F7BEE8951124229732962097B1F73F
:10FD7000F801E7BEE89507B600FCFDCFD7BEE895D1
:10FD800033C0843719F53AD0C82FD0E0DC2FCC2708
:10FD900035D05E01A82A32D0982E42D0E801F5E491
:10FDA0009F120BC0CE015BD022D081E0A81AB1080F
:10FDB0002196A114B104B1F717C0FE018791EF019C
:10FDC00016D0E1E0AE1AB108C1F70EC0853739F49C
:10FDD00027D08EE10CD087E90AD083E059CF813556
:10FDE00011F488E017D01CD080E101D047CF90916A
:10FDF000C00095FFFCCF8093C60008958091C0009D
:10FE000087FFFCCF8091C00084FD01C0A895809140
:10FE1000C6000895E0E6F0E098E1908380830895BD
:10FE2000EDDF803219F088E0F5DFFFCF84E1DFCF2E
:10FE3000CF93C82FE3DFC150E9F7CF91F1CFFC0199
:10FE40000A0167BFE895112407B600FCFDCF667074
:10FE500029F0452B19F481E187BFE8950895F999B8
:10FE6000FECF92BD81BDF89A992780B50895262FBF
:10FE7000F999FECF1FBA92BD81BD20BD0FB6F8948F
:10FE8000FA9AF99A0FBE01960895FF566572736942
:10FE90006F6E3D382E33004465766963653D61744D
:10FEA0006D6567613132383000465F4350553D31F2
:10FEB000363030303030304C00424947424F4F549A
:10FEC0003D31004275696C743A4E6F7620203420C3
:10FED000323032313A31383A30333A3033005541EA
:10FEE00052543D3000424155445F524154453D31EA
:10FEF0003135323030004C45443D4237004C4544AA
:10FF00005F53544152545F464C41534845533D332F
:01FF100000F0
:02FFFE000308F6
:040000031000FC00ED
:00000001FF

File diff suppressed because it is too large Load Diff

View File

@ -1,33 +1,33 @@
:107E000001C0DEC0112484B7882361F0982F9A70D6
:107E000001C0DAC0112484B7882361F0982F9A70DA
:107E1000923041F081FF02C097EF94BF282E80E09E
:107E2000BAD0EEC085E08093810082E08093C000EC
:107E2000B6D0EEC085E08093810082E08093C000F0
:107E300088E18093C10086E08093C20080E1809356
:107E4000C4008EE0A8D0259A86E020E33CEF91E0C4
:107E4000C4008EE0A4D0259A86E020E33CEF91E0C8
:107E5000309385002093840096BBB09BFECF1D9A83
:107E6000A8954091C00047FD02C0815089F7EE24DB
:107E7000E39495E0D92E21E1C22E81D0813471F4B2
:107E80007ED0182F8ED0123811F481E005C0113841
:107E900011F488E001C083E06BD067C0823411F434
:107EA00084E103C0853419F485E083D05EC0853554
:107EB00039F465D0C82F63D0D82FCC0FDD1F54C044
:107EC000863521F484E075D080E0E6CF843609F071
:107ED0002EC055D054D0F82E52D0B82E00E011E06C
:107EE0004ED0F80181938F01FE12FACF5AD0F5E4FB
:107EF000BF1201C0FFCF83E0FE0187BFE89507B640
:107F000000FCFDCFA0E0B1E0FE018D919D910C0140
:107F1000E7BEE89511243296FA12F7CFFE01D7BEDC
:107F2000E89507B600FCFDCFC7BEE8951EC08437B4
:107F300071F425D024D0F82E22D033D08E01F80150
:107F400085918F0115D0FA94F110F9CF0EC08537C5
:107F500039F427D08EE10CD085E90AD08FE09CCF90
:107F6000813511F488E017D01CD080E101D085CF95
:107F70009091C00095FFFCCF8093C600089580913A
:107F8000C00087FFFCCF8091C00084FD01C0A89590
:107F90008091C6000895E0E6F0E098E19083808348
:107FA0000895EDDF803219F088E0F5DFFFCF84E13E
:107FB000DFCFCF93C82FE3DFC150E9F7CF91F1CFE7
:107FC000FC010A0167BFE895112407B600FCFDCF4C
:107FD000667029F0452B19F481E187BFE895089573
:027FFE00010878
:107E7000E39495E0D92E21E1C22E7DD0813451F4D6
:107E80007AD0182F8AD0113811F083E001C088E031
:107E90006BD067C0823411F484E103C0853419F4D7
:107EA00085E083D05EC0853539F465D0C82F63D0B6
:107EB000D82FCC0FDD1F54C0863521F484E075D057
:107EC00080E0E6CF843609F02EC055D054D0F82E8D
:107ED00052D0B82E00E011E04ED0F80181938F010E
:107EE000FE12FACF5AD0F5E4BF1201C0FFCF83E0F3
:107EF000FE0187BFE89507B600FCFDCFA0E0B1E02A
:107F0000FE018D919D910C01E7BEE89511243296FA
:107F1000FA12F7CFFE01D7BEE89507B600FCFDCFF9
:107F2000C7BEE8951EC0843771F425D024D0F82E42
:107F300022D033D08E01F80185918F0115D0FA94AB
:107F4000F110F9CF0EC0853739F427D08EE10CD06F
:107F500085E90AD08FE09CCF813511F488E017D0F5
:107F60001CD080E101D089CF9091C00095FFFCCF5B
:107F70008093C60008958091C00087FFFCCF809158
:107F8000C00084FD01C0A8958091C6000895E0E678
:107F9000F0E098E1908380830895EDDF803219F05E
:107FA00088E0F5DFFFCF84E1DFCFCF93C82FE3DF99
:107FB000C150E9F7CF91F1CFFC010A0167BFE89505
:107FC000112407B600FCFDCF667029F0452B19F48B
:087FD00081E187BFE8950895E7
:027FFE00030876
:0400000300007E007B
:00000001FF

View File

@ -3,29 +3,29 @@ optiboot_atmega328.elf: file format elf32-avr
Sections:
Idx Name Size VMA LMA File off Algn
0 .data 00000000 00800100 00007fe0 00000274 2**0
CONTENTS, ALLOC, LOAD, DATA
1 .text 000001e0 00007e00 00007e00 00000094 2**1
0 .text 000001d8 00007e00 00007e00 00000074 2**0
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .version 00000002 00007ffe 00007ffe 00000274 2**0
1 .trampolines 00000000 00007fd8 00007fd8 0000024c 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .version 00000002 00007ffe 00007ffe 0000024c 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 .comment 0000002f 00000000 00000000 00000276 2**0
3 .comment 0000002f 00000000 00000000 0000024e 2**0
CONTENTS, READONLY
4 .debug_aranges 00000030 00000000 00000000 000002a5 2**0
4 .debug_aranges 00000030 00000000 00000000 0000027d 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_info 000005f9 00000000 00000000 000002d5 2**0
5 .debug_info 00000638 00000000 00000000 000002ad 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_abbrev 000002c1 00000000 00000000 000008ce 2**0
6 .debug_abbrev 000002e6 00000000 00000000 000008e5 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_line 0000033b 00000000 00000000 00000b8f 2**0
7 .debug_line 00000344 00000000 00000000 00000bcb 2**0
CONTENTS, READONLY, DEBUGGING
8 .debug_frame 0000009c 00000000 00000000 00000ecc 2**2
8 .debug_frame 000000ac 00000000 00000000 00000f10 2**2
CONTENTS, READONLY, DEBUGGING
9 .debug_str 00000200 00000000 00000000 00000f68 2**0
9 .debug_str 00000220 00000000 00000000 00000fbc 2**0
CONTENTS, READONLY, DEBUGGING
10 .debug_loc 00000359 00000000 00000000 00001168 2**0
10 .debug_loc 00000359 00000000 00000000 000011dc 2**0
CONTENTS, READONLY, DEBUGGING
11 .debug_ranges 00000080 00000000 00000000 000014c1 2**0
11 .debug_ranges 00000068 00000000 00000000 00001535 2**0
CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:
@ -33,12 +33,12 @@ Disassembly of section .text:
00007e00 <pre_main>:
/* everything that needs to run VERY early */
void pre_main(void) {
// Allow convenient way of calling do_spm function - jump table,
// so entry to this function will always be here, indepedent of compilation,
// features etc
// Allow convenient way of calling do_spm function - jump table, so
// entry to this function will always be here, independent of
// compilation, features etc
asm volatile (
7e00: 01 c0 rjmp .+2 ; 0x7e04 <main>
7e02: de c0 rjmp .+444 ; 0x7fc0 <do_spm>
7e02: da c0 rjmp .+436 ; 0x7fb8 <do_spm>
00007e04 <main>:
// SP points to RAMEND
@ -46,39 +46,38 @@ void pre_main(void) {
//
// If not, uncomment the following instructions:
// cli();
asm volatile ("clr __zero_reg__");
asm volatile (" clr __zero_reg__");
7e04: 11 24 eor r1, r1
#if defined(__AVR_ATmega8515__) || defined(__AVR_ATmega8535__) || \
defined(__AVR_ATmega16__) || defined(__AVR_ATmega162__) || \
defined (__AVR_ATmega128__)
ch = MCUCSR;
#else
# warning "START_APP_ON_EXTR is defined and NO_START_APP_ON_POR isn't"
# define APP_START_REASONS 1 /* Always start rge App. */
# define WDRF_CLR_REASONS 0 /* Never clear WDRF */
#endif
ch = MCUSR;
7e06: 84 b7 in r24, 0x34 ; 52
#endif
// Skip all logic and run bootloader if MCUSR is cleared (application request)
if (ch != 0) {
7e08: 88 23 and r24, r24
7e0a: 61 f0 breq .+24 ; 0x7e24 <main+0x20>
* 2. we clear WDRF if it's set with EXTRF to avoid loops
* One problematic scenario: broken application code sets watchdog timer
* without clearing MCUSR before and triggers it quickly. But it's
* recoverable by power-on with pushed reset button.
*/
if ((ch & (_BV(WDRF) | _BV(EXTRF))) != _BV(EXTRF)) {
if (APP_START_REASONS) {
7e0c: 98 2f mov r25, r24
7e0e: 9a 70 andi r25, 0x0A ; 10
7e10: 92 30 cpi r25, 0x02 ; 2
7e12: 41 f0 breq .+16 ; 0x7e24 <main+0x20>
if (ch & _BV(EXTRF)) {
if (WDRF_CLR_REASONS) {
7e14: 81 ff sbrs r24, 1
7e16: 02 c0 rjmp .+4 ; 0x7e1c <main+0x18>
defined(__AVR_ATmega16__) || defined(__AVR_ATmega162__) || \
defined(__AVR_ATmega128__)
// Fix missing definitions in avr-libc
MCUCSR = ~(_BV(WDRF));
#else
MCUSR = ~(_BV(WDRF));
/*
* Clear WDRF if it was most probably set by wdr in bootloader.
*/
if ((uint16_t)&MCUSR > 0x1F) {
MCUSR = ~(_BV(WDRF)); // optimize to LDI/OUT
7e18: 97 ef ldi r25, 0xF7 ; 247
7e1a: 94 bf out 0x34, r25 ; 52
/*
@ -86,73 +85,78 @@ void pre_main(void) {
* This can be saved in a main program by putting code in .init0 (which
* executes before normal c init code) to save R2 to a global variable.
*/
__asm__ __volatile__ ("mov r2, %0\n" :: "r" (ch));
__asm__ __volatile__ (" mov r2, %0\n" :: "r" (ch));
7e1c: 28 2e mov r2, r24
// switch off watchdog
watchdogConfig(WATCHDOG_OFF);
7e1e: 80 e0 ldi r24, 0x00 ; 0
7e20: ba d0 rcall .+372 ; 0x7f96 <watchdogConfig>
7e20: b6 d0 rcall .+364 ; 0x7f8e <watchdogConfig>
// Note that appstart_vec is defined so that this works with either
// real or virtual boot partitions.
__asm__ __volatile__ (
7e22: ee c0 rjmp .+476 ; 0x8000 <optiboot_version+0x2>
7e22: ee c0 rjmp .+476 ; 0x8000 <__VERSION_START__+0x2>
#elif defined(__AVR_ATtiny25__)||defined(__AVR_ATtiny45__)||defined(__AVR_ATtiny85__)
TCCR1 = 0x0E; //div 8196 - it's an 8-bit timer.
#elif defined(__AVR_ATtiny43__)
#error "LED flash for Tiny43 not yet supported"
#error "LED flash for Tiny43 not yet supported"
#else
TCCR1B = _BV(CS12) | _BV(CS10); // div 1024
7e24: 85 e0 ldi r24, 0x05 ; 5
7e26: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7e0081>
7e26: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__RAM__+0x81>
LINBTR = (1 << LDISR) | (8 << LBT0);
LINCR = _BV(LENA) | _BV(LCMD2) | _BV(LCMD1) | _BV(LCMD0);
LINDAT=0;
#else
#ifndef SINGLESPEED
#else
#if (SINGLESPEED == 0)
UART_SRA = _BV(U2X0); //Double speed mode USART0
7e2a: 82 e0 ldi r24, 0x02 ; 2
7e2c: 80 93 c0 00 sts 0x00C0, r24 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7e00c0>
#endif
7e2c: 80 93 c0 00 sts 0x00C0, r24 ; 0x8000c0 <__RAM__+0xc0>
#endif
UART_SRB = _BV(RXEN0) | _BV(TXEN0);
7e30: 88 e1 ldi r24, 0x18 ; 24
7e32: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7e00c1>
7e32: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__RAM__+0xc1>
UART_SRC = _BV(UCSZ00) | _BV(UCSZ01);
7e36: 86 e0 ldi r24, 0x06 ; 6
7e38: 80 93 c2 00 sts 0x00C2, r24 ; 0x8000c2 <__TEXT_REGION_LENGTH__+0x7e00c2>
7e38: 80 93 c2 00 sts 0x00C2, r24 ; 0x8000c2 <__RAM__+0xc2>
UART_SRL = (uint8_t)BAUD_SETTING;
7e3c: 80 e1 ldi r24, 0x10 ; 16
7e3e: 80 93 c4 00 sts 0x00C4, r24 ; 0x8000c4 <__TEXT_REGION_LENGTH__+0x7e00c4>
#endif // LIN_UART
#endif // mega8/etc
#endif // soft_uart
7e3e: 80 93 c4 00 sts 0x00C4, r24 ; 0x8000c4 <__RAM__+0xc4>
RS485_PORT &= ~_BV(RS485_BIT);
#endif
#endif
// Set up watchdog to trigger after desired timeout
watchdogConfig(WDTPERIOD);
7e42: 8e e0 ldi r24, 0x0E ; 14
7e44: a8 d0 rcall .+336 ; 0x7f96 <watchdogConfig>
7e44: a4 d0 rcall .+328 ; 0x7f8e <watchdogConfig>
#if (LED_START_FLASHES > 0) || defined(LED_DATA_FLASH) || defined(LED_START_ON)
#if (LED_START_FLASHES > 0) || LED_DATA_FLASH || LED_START_ON
/* Set LED pin as output */
LED_DDR |= _BV(LED);
7e46: 25 9a sbi 0x04, 5 ; 4
7e48: 86 e0 ldi r24, 0x06 ; 6
TIFR = _BV(TOV1);
while(!(TIFR & _BV(TOV1)));
#elif defined(__AVR_ATtiny43__)
#error "LED flash for Tiny43 not yet supported"
#else
while (!(TIFR & _BV(TOV1)));
#elif defined(__AVR_ATtiny43__)
#error "LED flash for Tiny43 not yet supported"
#else
TCNT1 = -(F_CPU/(1024*16));
7e4a: 20 e3 ldi r18, 0x30 ; 48
7e4c: 3c ef ldi r19, 0xFC ; 252
TIFR1 = _BV(TOV1);
7e4e: 91 e0 ldi r25, 0x01 ; 1
TIFR = _BV(TOV1);
while (!(TIFR & _BV(TOV1)));
#elif defined(__AVR_ATtiny43__)
#error "LED flash for Tiny43 not yet supported"
#else
TCNT1 = -(F_CPU/(1024*16));
7e50: 30 93 85 00 sts 0x0085, r19 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7e0085>
7e54: 20 93 84 00 sts 0x0084, r18 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7e0084>
7e50: 30 93 85 00 sts 0x0085, r19 ; 0x800085 <__RAM__+0x85>
7e54: 20 93 84 00 sts 0x0084, r18 ; 0x800084 <__RAM__+0x84>
TIFR1 = _BV(TOV1);
7e58: 96 bb out 0x16, r25 ; 22
while(!(TIFR1 & _BV(TOV1)));
while (!(TIFR1 & _BV(TOV1)));
7e5a: b0 9b sbis 0x16, 0 ; 22
7e5c: fe cf rjmp .-4 ; 0x7e5a <main+0x56>
defined(__AVR_ATmega8535__) || defined(__AVR_ATmega16__) || \
@ -160,7 +164,7 @@ void pre_main(void) {
defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__)
LED_PORT ^= _BV(LED);
#else
LED_PIN |= _BV(LED);
LED_PIN |= _BV(LED); // Newer AVRs can toggle by writing PINx
7e5e: 1d 9a sbi 0x03, 5 ; 3
}
#endif
@ -169,14 +173,29 @@ void pre_main(void) {
void watchdogReset() {
__asm__ __volatile__ (
7e60: a8 95 wdr
* by the UART hardware, avrdude sends several attempts in rather
* quick succession, some of which will be lost and cause us to
* get out of sync. So if we see any data; stop blinking.
*/
#ifndef LIN_UART
if (UART_SRA & _BV(RXC0))
7e62: 40 91 c0 00 lds r20, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7e00c0>
7e62: 40 91 c0 00 lds r20, 0x00C0 ; 0x8000c0 <__RAM__+0xc0>
7e66: 47 fd sbrc r20, 7
7e68: 02 c0 rjmp .+4 ; 0x7e6e <main+0x6a>
7e6a: 81 50 subi r24, 0x01 ; 1
#else
// This doesn't seem to work?
// if ((UART_PIN & (1<<UART_RX_BIT)) == 0)
// break; // detect start bit on soft uart too.
#endif
} while (--count);
7e6c: 89 f7 brne .-30 ; 0x7e50 <main+0x4c>
putch(optiboot_version & 0xFF);
/*
* Copy data from the buffer into the flash write buffer.
*/
do {
__boot_page_fill_short((uint16_t)(void*)addrPtr, *(mybuff.wptr++));
7e6e: ee 24 eor r14, r14
7e70: e3 94 inc r14
} while (len -= 2);
@ -192,282 +211,426 @@ void watchdogReset() {
// Reenable read access to flash
__boot_rww_enable_short();
7e76: 21 e1 ldi r18, 0x11 ; 17
#endif
/* Forever loop: exits by causing WDT reset */
for (;;) {
/* get character from UART */
ch = getch();
7e78: c2 2e mov r12, r18
if(ch == STK_GET_PARAMETER) {
7e7a: 81 d0 rcall .+258 ; 0x7f7e <getch>
if (ch == STK_GET_PARAMETER) {
7e7a: 7d d0 rcall .+250 ; 0x7f76 <getch>
unsigned char which = getch();
7e7c: 81 34 cpi r24, 0x41 ; 65
7e7e: 71 f4 brne .+28 ; 0x7e9c <main+0x98>
7e80: 7e d0 rcall .+252 ; 0x7f7e <getch>
7e7e: 51 f4 brne .+20 ; 0x7e94 <main+0x90>
7e80: 7a d0 rcall .+244 ; 0x7f76 <getch>
verifySpace();
7e82: 18 2f mov r17, r24
7e84: 8e d0 rcall .+284 ; 0x7fa2 <verifySpace>
7e84: 8a d0 rcall .+276 ; 0x7f9a <verifySpace>
* Send optiboot version as "SW version"
* Note that the references to memory are optimized away.
*/
if (which == STK_SW_MINOR) {
7e86: 12 38 cpi r17, 0x82 ; 130
7e88: 11 f4 brne .+4 ; 0x7e8e <main+0x8a>
putch(optiboot_version & 0xFF);
7e8a: 81 e0 ldi r24, 0x01 ; 1
7e8c: 05 c0 rjmp .+10 ; 0x7e98 <main+0x94>
} else if (which == STK_SW_MAJOR) {
7e8e: 11 38 cpi r17, 0x81 ; 129
7e86: 11 38 cpi r17, 0x81 ; 129
/*
* Send optiboot version as "SW version"
* Note that the references to memory are optimized away.
*/
if (which == STK_SW_MINOR) {
putch(optiboot_version & 0xFF);
7e88: 11 f0 breq .+4 ; 0x7e8e <main+0x8a>
7e8a: 83 e0 ldi r24, 0x03 ; 3
} else if (which == STK_SW_MAJOR) {
putch(optiboot_version >> 8);
7e90: 11 f4 brne .+4 ; 0x7e96 <main+0x92>
7e92: 88 e0 ldi r24, 0x08 ; 8
7e8c: 01 c0 rjmp .+2 ; 0x7e90 <main+0x8c>
7e8e: 88 e0 ldi r24, 0x08 ; 8
7e90: 6b d0 rcall .+214 ; 0x7f68 <putch>
7e92: 67 c0 rjmp .+206 ; 0x7f62 <main+0x15e>
* other parameters - enough to keep Avrdude happy
*/
putch(0x03);
7e94: 01 c0 rjmp .+2 ; 0x7e98 <main+0x94>
7e96: 83 e0 ldi r24, 0x03 ; 3
7e98: 6b d0 rcall .+214 ; 0x7f70 <putch>
7e9a: 67 c0 rjmp .+206 ; 0x7f6a <main+0x166>
else if(ch == STK_SET_DEVICE) {
7e9c: 82 34 cpi r24, 0x42 ; 66
}
}
else if (ch == STK_SET_DEVICE) {
7e94: 82 34 cpi r24, 0x42 ; 66
// SET DEVICE is ignored
getNch(20);
7e9e: 11 f4 brne .+4 ; 0x7ea4 <main+0xa0>
7ea0: 84 e1 ldi r24, 0x14 ; 20
else if(ch == STK_SET_DEVICE_EXT) {
7ea2: 03 c0 rjmp .+6 ; 0x7eaa <main+0xa6>
7e96: 11 f4 brne .+4 ; 0x7e9c <main+0x98>
7e98: 84 e1 ldi r24, 0x14 ; 20
}
else if (ch == STK_SET_DEVICE_EXT) {
7e9a: 03 c0 rjmp .+6 ; 0x7ea2 <main+0x9e>
// SET DEVICE EXT is ignored
getNch(5);
7ea4: 85 34 cpi r24, 0x45 ; 69
7ea6: 19 f4 brne .+6 ; 0x7eae <main+0xaa>
7ea8: 85 e0 ldi r24, 0x05 ; 5
else if(ch == STK_LOAD_ADDRESS) {
7eaa: 83 d0 rcall .+262 ; 0x7fb2 <getNch>
7eac: 5e c0 rjmp .+188 ; 0x7f6a <main+0x166>
7e9c: 85 34 cpi r24, 0x45 ; 69
7e9e: 19 f4 brne .+6 ; 0x7ea6 <main+0xa2>
7ea0: 85 e0 ldi r24, 0x05 ; 5
}
else if (ch == STK_LOAD_ADDRESS) {
7ea2: 83 d0 rcall .+262 ; 0x7faa <getNch>
7ea4: 5e c0 rjmp .+188 ; 0x7f62 <main+0x15e>
// LOAD ADDRESS
address.bytes[0] = getch();
7eae: 85 35 cpi r24, 0x55 ; 85
7eb0: 39 f4 brne .+14 ; 0x7ec0 <main+0xbc>
7eb2: 65 d0 rcall .+202 ; 0x7f7e <getch>
7ea6: 85 35 cpi r24, 0x55 ; 85
7ea8: 39 f4 brne .+14 ; 0x7eb8 <main+0xb4>
7eaa: 65 d0 rcall .+202 ; 0x7f76 <getch>
address.bytes[1] = getch();
7eb4: c8 2f mov r28, r24
7eb6: 63 d0 rcall .+198 ; 0x7f7e <getch>
7eac: c8 2f mov r28, r24
7eae: 63 d0 rcall .+198 ; 0x7f76 <getch>
}
else {
RAMPZ &= 0xFE;
}
#endif
address.word *= 2; // Convert from word address to byte address
7eb8: d8 2f mov r29, r24
7eba: cc 0f add r28, r28
7ebc: dd 1f adc r29, r29
else if(ch == STK_UNIVERSAL) {
7ebe: 54 c0 rjmp .+168 ; 0x7f68 <main+0x164>
getNch(4);
7ec0: 86 35 cpi r24, 0x56 ; 86
7ec2: 21 f4 brne .+8 ; 0x7ecc <main+0xc8>
7eb0: d8 2f mov r29, r24
7eb2: cc 0f add r28, r28
7eb4: dd 1f adc r29, r29
verifySpace();
}
else if (ch == STK_UNIVERSAL) {
7eb6: 54 c0 rjmp .+168 ; 0x7f60 <main+0x15c>
getNch(3);
putch(0x00);
7ec4: 84 e0 ldi r24, 0x04 ; 4
7ec6: 75 d0 rcall .+234 ; 0x7fb2 <getNch>
else if(ch == STK_PROG_PAGE) {
7ec8: 80 e0 ldi r24, 0x00 ; 0
7eca: e6 cf rjmp .-52 ; 0x7e98 <main+0x94>
}
#else
// UNIVERSAL command is ignored
getNch(4);
7eb8: 86 35 cpi r24, 0x56 ; 86
7eba: 21 f4 brne .+8 ; 0x7ec4 <main+0xc0>
putch(0x00);
7ebc: 84 e0 ldi r24, 0x04 ; 4
7ebe: 75 d0 rcall .+234 ; 0x7faa <getNch>
#endif
}
/* Write memory, length is big endian and is in bytes */
else if (ch == STK_PROG_PAGE) {
7ec0: 80 e0 ldi r24, 0x00 ; 0
7ec2: e6 cf rjmp .-52 ; 0x7e90 <main+0x8c>
// PROGRAM PAGE - we support flash programming only, not EEPROM
uint8_t desttype;
uint8_t *bufPtr;
pagelen_t savelength;
GETLENGTH(length);
7ecc: 84 36 cpi r24, 0x64 ; 100
7ece: 09 f0 breq .+2 ; 0x7ed2 <main+0xce>
7ed0: 2e c0 rjmp .+92 ; 0x7f2e <main+0x12a>
7ed2: 55 d0 rcall .+170 ; 0x7f7e <getch>
7ec4: 84 36 cpi r24, 0x64 ; 100
7ec6: 09 f0 breq .+2 ; 0x7eca <main+0xc6>
7ec8: 2e c0 rjmp .+92 ; 0x7f26 <main+0x122>
7eca: 55 d0 rcall .+170 ; 0x7f76 <getch>
savelength = length;
desttype = getch();
7ed4: 54 d0 rcall .+168 ; 0x7f7e <getch>
7ed6: f8 2e mov r15, r24
7ed8: 52 d0 rcall .+164 ; 0x7f7e <getch>
7eda: b8 2e mov r11, r24
7edc: 00 e0 ldi r16, 0x00 ; 0
7ecc: 54 d0 rcall .+168 ; 0x7f76 <getch>
7ece: f8 2e mov r15, r24
7ed0: 52 d0 rcall .+164 ; 0x7f76 <getch>
7ed2: b8 2e mov r11, r24
7ed4: 00 e0 ldi r16, 0x00 ; 0
// read a page worth of contents
bufPtr = buff.bptr;
do *bufPtr++ = getch();
7ede: 11 e0 ldi r17, 0x01 ; 1
7ee0: 4e d0 rcall .+156 ; 0x7f7e <getch>
7ee2: f8 01 movw r30, r16
7ee4: 81 93 st Z+, r24
7ee6: 8f 01 movw r16, r30
7ed6: 11 e0 ldi r17, 0x01 ; 1
7ed8: 4e d0 rcall .+156 ; 0x7f76 <getch>
7eda: f8 01 movw r30, r16
7edc: 81 93 st Z+, r24
7ede: 8f 01 movw r16, r30
while (--length);
7ee8: fe 12 cpse r15, r30
7eea: fa cf rjmp .-12 ; 0x7ee0 <main+0xdc>
7ee0: fe 12 cpse r15, r30
7ee2: fa cf rjmp .-12 ; 0x7ed8 <main+0xd4>
// Read command terminator, start reply
verifySpace();
7eec: 5a d0 rcall .+180 ; 0x7fa2 <verifySpace>
7eee: f5 e4 ldi r31, 0x45 ; 69
7ee4: 5a d0 rcall .+180 ; 0x7f9a <verifySpace>
7ee6: f5 e4 ldi r31, 0x45 ; 69
* void writebuffer(memtype, buffer, address, length)
*/
static inline void writebuffer(int8_t memtype, addr16_t mybuff,
addr16_t address, pagelen_t len)
{
switch (memtype) {
7ef0: bf 12 cpse r11, r31
7ef2: 01 c0 rjmp .+2 ; 0x7ef6 <main+0xf2>
7ef4: ff cf rjmp .-2 ; 0x7ef4 <main+0xf0>
7ef6: 83 e0 ldi r24, 0x03 ; 3
7ee8: bf 12 cpse r11, r31
7eea: 01 c0 rjmp .+2 ; 0x7eee <main+0xea>
7eec: ff cf rjmp .-2 ; 0x7eec <main+0xe8>
7eee: 83 e0 ldi r24, 0x03 ; 3
* and we needed the space back.
*/
#ifdef FOURPAGEERASE
if ((address.bytes[0] & ((SPM_PAGESIZE<<2)-1))==0) {
#endif
__boot_page_erase_short(address.word);
7ef8: fe 01 movw r30, r28
7efa: 87 bf out 0x37, r24 ; 55
7efc: e8 95 spm
7efe: 07 b6 in r0, 0x37 ; 55
7ef0: fe 01 movw r30, r28
7ef2: 87 bf out 0x37, r24 ; 55
7ef4: e8 95 spm
7ef6: 07 b6 in r0, 0x37 ; 55
boot_spm_busy_wait();
7f00: 00 fc sbrc r0, 0
7f02: fd cf rjmp .-6 ; 0x7efe <main+0xfa>
7f04: a0 e0 ldi r26, 0x00 ; 0
7f06: b1 e0 ldi r27, 0x01 ; 1
7f08: fe 01 movw r30, r28
7f0a: 8d 91 ld r24, X+
7ef8: 00 fc sbrc r0, 0
7efa: fd cf rjmp .-6 ; 0x7ef6 <main+0xf2>
7efc: a0 e0 ldi r26, 0x00 ; 0
7efe: b1 e0 ldi r27, 0x01 ; 1
7f00: fe 01 movw r30, r28
7f02: 8d 91 ld r24, X+
/*
* Copy data from the buffer into the flash write buffer.
*/
do {
__boot_page_fill_short((uint16_t)(void*)addrPtr, *(mybuff.wptr++));
7f0c: 9d 91 ld r25, X+
7f0e: 0c 01 movw r0, r24
7f10: e7 be out 0x37, r14 ; 55
7f12: e8 95 spm
7f14: 11 24 eor r1, r1
7f16: 32 96 adiw r30, 0x02 ; 2
7f04: 9d 91 ld r25, X+
7f06: 0c 01 movw r0, r24
7f08: e7 be out 0x37, r14 ; 55
7f0a: e8 95 spm
7f0c: 11 24 eor r1, r1
7f0e: 32 96 adiw r30, 0x02 ; 2
addrPtr += 2;
} while (len -= 2);
7f18: fa 12 cpse r15, r26
7f10: fa 12 cpse r15, r26
/*
* Actually Write the buffer to flash (and wait for it to finish.)
*/
__boot_page_write_short(address.word);
7f1a: f7 cf rjmp .-18 ; 0x7f0a <main+0x106>
7f1c: fe 01 movw r30, r28
7f12: f7 cf rjmp .-18 ; 0x7f02 <main+0xfe>
7f14: fe 01 movw r30, r28
boot_spm_busy_wait();
7f1e: d7 be out 0x37, r13 ; 55
7f20: e8 95 spm
7f16: d7 be out 0x37, r13 ; 55
7f18: e8 95 spm
#if defined(RWWSRE)
// Reenable read access to flash
__boot_rww_enable_short();
7f22: 07 b6 in r0, 0x37 ; 55
7f24: 00 fc sbrc r0, 0
7f26: fd cf rjmp .-6 ; 0x7f22 <main+0x11e>
else if(ch == STK_READ_PAGE) {
7f28: c7 be out 0x37, r12 ; 55
7f2a: e8 95 spm
7f1a: 07 b6 in r0, 0x37 ; 55
7f1c: 00 fc sbrc r0, 0
7f1e: fd cf rjmp .-6 ; 0x7f1a <main+0x116>
writebuffer(desttype, buff, address, savelength);
}
/* Read memory block mode, length is big endian. */
else if (ch == STK_READ_PAGE) {
7f20: c7 be out 0x37, r12 ; 55
7f22: e8 95 spm
uint8_t desttype;
GETLENGTH(length);
7f2c: 1e c0 rjmp .+60 ; 0x7f6a <main+0x166>
7f2e: 84 37 cpi r24, 0x74 ; 116
7f30: 71 f4 brne .+28 ; 0x7f4e <main+0x14a>
7f24: 1e c0 rjmp .+60 ; 0x7f62 <main+0x15e>
7f26: 84 37 cpi r24, 0x74 ; 116
7f28: 71 f4 brne .+28 ; 0x7f46 <main+0x142>
desttype = getch();
7f32: 25 d0 rcall .+74 ; 0x7f7e <getch>
7f2a: 25 d0 rcall .+74 ; 0x7f76 <getch>
verifySpace();
7f34: 24 d0 rcall .+72 ; 0x7f7e <getch>
7f36: f8 2e mov r15, r24
7f38: 22 d0 rcall .+68 ; 0x7f7e <getch>
7f2c: 24 d0 rcall .+72 ; 0x7f76 <getch>
7f2e: f8 2e mov r15, r24
7f30: 22 d0 rcall .+68 ; 0x7f76 <getch>
// while (--length);
// read a Flash and increment the address (may increment RAMPZ)
__asm__ ("elpm %0,Z+\n" : "=r" (ch), "=z" (address.bptr): "1" (address));
__asm__ (" elpm %0,Z+\n" : "=r" (ch), "=z" (address.bptr): "1" (address));
#else
// read a Flash byte and increment the address
__asm__ ("lpm %0,Z+\n" : "=r" (ch), "=z" (address.bptr): "1" (address));
7f3a: 33 d0 rcall .+102 ; 0x7fa2 <verifySpace>
7f3c: 8e 01 movw r16, r28
__asm__ (" lpm %0,Z+\n" : "=r" (ch), "=z" (address.bptr): "1" (address));
7f32: 33 d0 rcall .+102 ; 0x7f9a <verifySpace>
7f34: 8e 01 movw r16, r28
#endif
putch(ch);
7f3e: f8 01 movw r30, r16
7f36: f8 01 movw r30, r16
} while (--length);
7f40: 85 91 lpm r24, Z+
7f42: 8f 01 movw r16, r30
7f44: 15 d0 rcall .+42 ; 0x7f70 <putch>
7f46: fa 94 dec r15
else if(ch == STK_READ_SIGN) {
7f48: f1 10 cpse r15, r1
7f4a: f9 cf rjmp .-14 ; 0x7f3e <main+0x13a>
verifySpace();
7f4c: 0e c0 rjmp .+28 ; 0x7f6a <main+0x166>
7f4e: 85 37 cpi r24, 0x75 ; 117
putch(SIGNATURE_0);
7f50: 39 f4 brne .+14 ; 0x7f60 <main+0x15c>
7f52: 27 d0 rcall .+78 ; 0x7fa2 <verifySpace>
7f54: 8e e1 ldi r24, 0x1E ; 30
putch(SIGNATURE_1);
7f56: 0c d0 rcall .+24 ; 0x7f70 <putch>
7f58: 85 e9 ldi r24, 0x95 ; 149
7f5a: 0a d0 rcall .+20 ; 0x7f70 <putch>
putch(SIGNATURE_2);
7f5c: 8f e0 ldi r24, 0x0F ; 15
7f5e: 9c cf rjmp .-200 ; 0x7e98 <main+0x94>
else if (ch == STK_LEAVE_PROGMODE) { /* 'Q' */
7f60: 81 35 cpi r24, 0x51 ; 81
7f62: 11 f4 brne .+4 ; 0x7f68 <main+0x164>
watchdogConfig(WATCHDOG_16MS);
7f64: 88 e0 ldi r24, 0x08 ; 8
7f66: 17 d0 rcall .+46 ; 0x7f96 <watchdogConfig>
7f68: 1c d0 rcall .+56 ; 0x7fa2 <verifySpace>
verifySpace();
7f6a: 80 e1 ldi r24, 0x10 ; 16
7f6c: 01 d0 rcall .+2 ; 0x7f70 <putch>
putch(STK_OK);
7f6e: 85 cf rjmp .-246 ; 0x7e7a <main+0x76>
7f38: 85 91 lpm r24, Z+
7f3a: 8f 01 movw r16, r30
7f3c: 15 d0 rcall .+42 ; 0x7f68 <putch>
7f3e: fa 94 dec r15
00007f70 <putch>:
7f70: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7e00c0>
read_mem(desttype, address, length);
}
7f74: 95 ff sbrs r25, 5
while (!(UART_SRA & _BV(UDRE0))) { /* Spin */ }
7f76: fc cf rjmp .-8 ; 0x7f70 <putch>
UART_UDR = ch;
7f78: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7e00c6>
7f7c: 08 95 ret
00007f7e <getch>:
while(!(UART_SRA & _BV(RXC0))) { /* Spin */ }
7f7e: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7e00c0>
7f82: 87 ff sbrs r24, 7
7f84: fc cf rjmp .-8 ; 0x7f7e <getch>
if (!(UART_SRA & _BV(FE0))) {
7f86: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7e00c0>
7f8a: 84 fd sbrc r24, 4
7f8c: 01 c0 rjmp .+2 ; 0x7f90 <getch+0x12>
__asm__ __volatile__ (
7f8e: a8 95 wdr
ch = UART_UDR;
7f90: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7e00c6>
}
7f94: 08 95 ret
00007f96 <watchdogConfig>:
WDTCSR = _BV(WDCE) | _BV(WDE);
7f96: e0 e6 ldi r30, 0x60 ; 96
7f98: f0 e0 ldi r31, 0x00 ; 0
7f9a: 98 e1 ldi r25, 0x18 ; 24
7f9c: 90 83 st Z, r25
WDTCSR = x;
7f9e: 80 83 st Z, r24
7fa0: 08 95 ret
00007fa2 <verifySpace>:
if (getch() != CRC_EOP) {
7fa2: ed df rcall .-38 ; 0x7f7e <getch>
7fa4: 80 32 cpi r24, 0x20 ; 32
7fa6: 19 f0 breq .+6 ; 0x7fae <verifySpace+0xc>
watchdogConfig(WATCHDOG_16MS); // shorten WD timeout
7fa8: 88 e0 ldi r24, 0x08 ; 8
7faa: f5 df rcall .-22 ; 0x7f96 <watchdogConfig>
7fac: ff cf rjmp .-2 ; 0x7fac <verifySpace+0xa>
putch(STK_INSYNC);
7fae: 84 e1 ldi r24, 0x14 ; 20
7fb0: df cf rjmp .-66 ; 0x7f70 <putch>
00007fb2 <getNch>:
void getNch(uint8_t count) {
7fb2: cf 93 push r28
7fb4: c8 2f mov r28, r24
do getch(); while (--count);
7fb6: e3 df rcall .-58 ; 0x7f7e <getch>
7fb8: c1 50 subi r28, 0x01 ; 1
7fba: e9 f7 brne .-6 ; 0x7fb6 <getNch+0x4>
}
7fbc: cf 91 pop r28
/* Get device signature bytes */
else if (ch == STK_READ_SIGN) {
7f40: f1 10 cpse r15, r1
7f42: f9 cf rjmp .-14 ; 0x7f36 <main+0x132>
// READ SIGN - return what Avrdude wants to hear
verifySpace();
7fbe: f1 cf rjmp .-30 ; 0x7fa2 <verifySpace>
7f44: 0e c0 rjmp .+28 ; 0x7f62 <main+0x15e>
7f46: 85 37 cpi r24, 0x75 ; 117
putch(SIGNATURE_0);
7f48: 39 f4 brne .+14 ; 0x7f58 <main+0x154>
7f4a: 27 d0 rcall .+78 ; 0x7f9a <verifySpace>
7f4c: 8e e1 ldi r24, 0x1E ; 30
putch(SIGNATURE_1);
7f4e: 0c d0 rcall .+24 ; 0x7f68 <putch>
7f50: 85 e9 ldi r24, 0x95 ; 149
7f52: 0a d0 rcall .+20 ; 0x7f68 <putch>
putch(SIGNATURE_2);
7f54: 8f e0 ldi r24, 0x0F ; 15
7f56: 9c cf rjmp .-200 ; 0x7e90 <main+0x8c>
}
else if (ch == STK_LEAVE_PROGMODE) { /* 'Q' */
7f58: 81 35 cpi r24, 0x51 ; 81
7f5a: 11 f4 brne .+4 ; 0x7f60 <main+0x15c>
// Adaboot no-wait mod
watchdogConfig(WATCHDOG_16MS);
7f5c: 88 e0 ldi r24, 0x08 ; 8
7f5e: 17 d0 rcall .+46 ; 0x7f8e <watchdogConfig>
7f60: 1c d0 rcall .+56 ; 0x7f9a <verifySpace>
verifySpace();
}
else {
// This covers the response to commands like STK_ENTER_PROGMODE
verifySpace();
7f62: 80 e1 ldi r24, 0x10 ; 16
7f64: 01 d0 rcall .+2 ; 0x7f68 <putch>
}
putch(STK_OK);
7f66: 89 cf rjmp .-238 ; 0x7e7a <main+0x76>
00007fc0 <do_spm>:
7fc0: fc 01 movw r30, r24
00007f68 <putch>:
7f68: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__RAM__+0xc0>
}
7f6c: 95 ff sbrs r25, 5
RS485_PORT |= _BV(RS485_BIT);
# else
RS485_PORT &= ~_BV(RS485_BIT);
# endif
#else //not RS485
while (!(UART_SRA & _BV(UDRE0))) { /* Spin */ }
7f6e: fc cf rjmp .-8 ; 0x7f68 <putch>
UART_UDR = ch;
7f70: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__RAM__+0xc6>
7f74: 08 95 ret
00007f76 <getch>:
:
"r25"
);
#else
#ifndef LIN_UART
while (!(UART_SRA & _BV(RXC0))) { /* Spin */ }
7f76: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__RAM__+0xc0>
7f7a: 87 ff sbrs r24, 7
7f7c: fc cf rjmp .-8 ; 0x7f76 <getch>
if (!(UART_SRA & _BV(FE0))) {
7f7e: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__RAM__+0xc0>
7f82: 84 fd sbrc r24, 4
7f84: 01 c0 rjmp .+2 ; 0x7f88 <getch+0x12>
}
#endif
// Watchdog functions. These are only safe with interrupts turned off.
void watchdogReset() {
__asm__ __volatile__ (
7f86: a8 95 wdr
while (!(LINSIR & _BV(LRXOK))) { /* Spin */ }
if (!(LINSIR & _BV(LFERR))) {
watchdogReset(); /* Eventually abort if wrong speed */
}
#endif
ch = UART_UDR;
7f88: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__RAM__+0xc6>
#if LED_DATA_FLASH
toggle_led();
#endif
return ch;
}
7f8c: 08 95 ret
00007f8e <watchdogConfig>:
}
void watchdogConfig(uint8_t x) {
#ifdef WDCE //does it have a Watchdog Change Enable?
#ifdef WDTCSR
WDTCSR = _BV(WDCE) | _BV(WDE);
7f8e: e0 e6 ldi r30, 0x60 ; 96
7f90: f0 e0 ldi r31, 0x00 ; 0
7f92: 98 e1 ldi r25, 0x18 ; 24
7f94: 90 83 st Z, r25
#else //then it must be one of those newfangled ones that use CCP
CCP=0xD8; //so write this magic number to CCP
#endif
#ifdef WDTCSR
WDTCSR = x;
7f96: 80 83 st Z, r24
7f98: 08 95 ret
00007f9a <verifySpace>:
do getch(); while (--count);
verifySpace();
}
void verifySpace() {
if (getch() != CRC_EOP) {
7f9a: ed df rcall .-38 ; 0x7f76 <getch>
7f9c: 80 32 cpi r24, 0x20 ; 32
7f9e: 19 f0 breq .+6 ; 0x7fa6 <verifySpace+0xc>
watchdogConfig(WATCHDOG_16MS); // shorten WD timeout
7fa0: 88 e0 ldi r24, 0x08 ; 8
7fa2: f5 df rcall .-22 ; 0x7f8e <watchdogConfig>
7fa4: ff cf rjmp .-2 ; 0x7fa4 <verifySpace+0xa>
while (1) // and busy-loop so that WD causes
; // a reset and app start.
}
putch(STK_INSYNC);
7fa6: 84 e1 ldi r24, 0x14 ; 20
7fa8: df cf rjmp .-66 ; 0x7f68 <putch>
00007faa <getNch>:
::[count] "M" (UART_B_VALUE)
);
}
#endif
void getNch(uint8_t count) {
7faa: cf 93 push r28
7fac: c8 2f mov r28, r24
do getch(); while (--count);
7fae: e3 df rcall .-58 ; 0x7f76 <getch>
7fb0: c1 50 subi r28, 0x01 ; 1
7fb2: e9 f7 brne .-6 ; 0x7fae <getNch+0x4>
verifySpace();
}
7fb4: cf 91 pop r28
}
#endif
void getNch(uint8_t count) {
do getch(); while (--count);
verifySpace();
7fb6: f1 cf rjmp .-30 ; 0x7f9a <verifySpace>
00007fb8 <do_spm>:
7fb8: fc 01 movw r30, r24
* data=0 in WRITE
*/
static void do_spm(uint16_t address, uint8_t command, uint16_t data) __attribute__ ((used));
static void do_spm(uint16_t address, uint8_t command, uint16_t data) {
// Do spm stuff
asm volatile (
7fc2: 0a 01 movw r0, r20
7fc4: 67 bf out 0x37, r22 ; 55
7fc6: e8 95 spm
7fc8: 11 24 eor r1, r1
7fca: 07 b6 in r0, 0x37 ; 55
7fba: 0a 01 movw r0, r20
7fbc: 67 bf out 0x37, r22 ; 55
7fbe: e8 95 spm
7fc0: 11 24 eor r1, r1
7fc2: 07 b6 in r0, 0x37 ; 55
);
// wait for spm to complete
// it doesn't have much sense for __BOOT_PAGE_FILL,
// but it doesn't hurt and saves some bytes on 'if'
boot_spm_busy_wait();
7fcc: 00 fc sbrc r0, 0
7fce: fd cf rjmp .-6 ; 0x7fca <do_spm+0xa>
7fd0: 66 70 andi r22, 0x06 ; 6
7fc4: 00 fc sbrc r0, 0
7fc6: fd cf rjmp .-6 ; 0x7fc2 <do_spm+0xa>
7fc8: 66 70 andi r22, 0x06 ; 6
#if defined(RWWSRE)
// this 'if' condition should be: (command == __BOOT_PAGE_WRITE || command == __BOOT_PAGE_ERASE)...
// but it's tweaked a little assuming that in every command we are interested in here, there
// must be also SELFPRGEN set. If we skip checking this bit, we save here 4B
if ((command & (_BV(PGWRT)|_BV(PGERS))) && (data == 0) ) {
7fd2: 29 f0 breq .+10 ; 0x7fde <do_spm+0x1e>
7fd4: 45 2b or r20, r21
7fd6: 19 f4 brne .+6 ; 0x7fde <do_spm+0x1e>
7fd8: 81 e1 ldi r24, 0x11 ; 17
7fca: 29 f0 breq .+10 ; 0x7fd6 <do_spm+0x1e>
7fcc: 45 2b or r20, r21
7fce: 19 f4 brne .+6 ; 0x7fd6 <do_spm+0x1e>
7fd0: 81 e1 ldi r24, 0x11 ; 17
// Reenable read access to flash
__boot_rww_enable_short();
7fda: 87 bf out 0x37, r24 ; 55
7fdc: e8 95 spm
7fde: 08 95 ret
7fd2: 87 bf out 0x37, r24 ; 55
7fd4: e8 95 spm
7fd6: 08 95 ret

View File

@ -1,52 +1,50 @@
:10FC000001C00DC1112484B7882361F0982F9A7028
:10FC000001C009C1112484B7882361F0982F9A702C
:10FC1000923041F081FF02C097EF94BF282E80E020
:10FC2000E9D0EEC185E08093810082E08093C0003E
:10FC2000E5D0EEC185E08093810082E08093C00042
:10FC300088E18093C10086E08093C20080E18093D8
:10FC4000C4008EE0D7D0209A86E020E33CEF91E01C
:10FC4000C4008EE0D3D0209A86E020E33CEF91E020
:10FC5000309385002093840096BBB09BFECF189A0A
:10FC6000A8954091C00047FD02C0815089F7FF244C
:10FC7000F39455E0E52E61E1D62EB0D0813471F4D5
:10FC8000ADD0C82FBDD0C23811F481E005C0C13855
:10FC900011F488E001C083E09AD096C0823411F458
:10FCA00084E103C0853419F485E0B2D08DC0853578
:10FCB00039F494D0082F92D0182F000F111F83C051
:10FCC000863521F484E0A4D080E0E6CF843609F0C4
:10FCD00048C084D0C82FD0E0DC2FCC277FD0C82BE1
:10FCE0007DD0C82E5E01812C9924939477D0F401A5
:10FCF00081934F01F1E0AF1AB108C1F781D085E4DB
:10FD0000C81212C0D3954801A12CBB24B394AC16E1
:10FD1000BD0609F459C0F50161915F01C40197D096
:10FD2000FFEF8F1A9F0AF3CF83E0F80187BFE895B2
:10FD300007B600FCFDCFA0E0B1E0F8018D919D91E8
:10FD40000C01F7BEE8951124229732962097B1F75F
:10FD5000F801E7BEE89507B600FCFDCFD7BEE895F1
:10FD600033C0843719F53AD0C82FD0E0DC2FCC2728
:10FD700035D05E01A82A32D0982E42D0E801F5E4B1
:10FD80009F120BC0CE015BD022D081E0A81AB1082F
:10FD90002196A114B104B1F717C0FE018591EF01BE
:10FDA00016D0E1E0AE1AB108C1F70EC0853739F4BC
:10FDB00027D08EE10CD086E90AD08AE06DCF81355C
:10FDC00011F488E017D01CD080E101D056CF90917B
:10FDD000C00095FFFCCF8093C60008958091C000BD
:10FDE00087FFFCCF8091C00084FD01C0A895809161
:10FDF000C6000895E0E6F0E098E1908380830895DE
:10FE0000EDDF803219F088E0F5DFFFCF84E1DFCF4E
:10FE1000CF93C82FE3DFC150E9F7CF91F1CFFC01B9
:10FE20000A0167BFE895112407B600FCFDCF667094
:10FE300029F0452B19F481E187BFE8950895F999D8
:10FE4000FECF92BD81BDF89A992780B50895262FDF
:10FE5000F999FECF1FBA92BD81BD20BD0FB6F894AF
:10FE6000FA9AF99A0FBE0196089556657273696FF2
:10FE70006E3D382E31004F505449424F4F545F432E
:10FE80005553544F4D5645523D3000446576696395
:10FE9000653D61746D6567613634347000465F435B
:10FEA00050553D31363030303030304C00424947CB
:10FEB000424F4F543D31004275696C743A4D61793F
:10FEC00020323920323032303A30313A30323A3220
:10FED0003600554152543D3000424155445F524135
:10FEE00054453D313135323030004C45443D42308F
:10FEF000004C45445F53544152545F464C41534873
:05FF000045533D3300F4
:02FFFE000108F8
:10FC7000F39455E0E52E61E1D62EACD0813451F4F9
:10FC8000A9D0C82FB9D0C13811F083E001C088E0F5
:10FC90009AD096C0823411F484E103C0853419F4FB
:10FCA00085E0B2D08DC0853539F494D0082F92D03C
:10FCB000182F000F111F83C0863521F484E0A4D0D3
:10FCC00080E0E6CF843609F048C084D0C82FD0E069
:10FCD000DC2FCC277FD0C82B7DD0C82E5E01812C95
:10FCE0009924939477D0F40181934F01F1E0AF1AF6
:10FCF000B108C1F781D085E4C81212C0D39548017C
:10FD0000A12CBB24B394AC16BD0609F459C0F5016F
:10FD100061915F01C40197D0FFEF8F1A9F0AF3CF63
:10FD200083E0F80187BFE89507B600FCFDCFA0E0AF
:10FD3000B1E0F8018D919D910C01F7BEE895112479
:10FD4000229732962097B1F7F801E7BEE89507B6FB
:10FD500000FCFDCFD7BEE89533C0843719F53AD003
:10FD6000C82FD0E0DC2FCC2735D05E01A82A32D0B6
:10FD7000982E42D0E801F5E49F120BC0CE015BD073
:10FD800022D081E0A81AB1082196A114B104B1F7DC
:10FD900017C0FE018591EF0116D0E1E0AE1AB1085F
:10FDA000C1F70EC0853739F427D08EE10CD086E933
:10FDB0000AD08AE06DCF813511F488E017D01CD0CD
:10FDC00080E101D05ACF9091C00095FFFCCF809385
:10FDD000C60008958091C00087FFFCCF8091C000CD
:10FDE00084FD01C0A8958091C6000895E0E6F0E08A
:10FDF00098E1908380830895EDDF803219F088E0E8
:10FE0000F5DFFFCF84E1DFCFCF93C82FE3DFC15011
:10FE1000E9F7CF91F1CFFC010A0167BFE895112402
:10FE200007B600FCFDCF667029F0452B19F481E17F
:10FE300087BFE8950895F999FECF92BD81BDF89AE4
:10FE4000992780B50895262FF999FECF1FBA92BD44
:10FE500081BD20BD0FB6F894FA9AF99A0FBE0196AB
:10FE60000895FF56657273696F6E3D382E330044F6
:10FE700065766963653D61746D65676136343470BC
:10FE800000465F4350553D31363030303030304CD5
:10FE900000424947424F4F543D31004275696C74EE
:10FEA0003A4E6F7620203420323032313A31383AAF
:10FEB00030333A313400554152543D3000424155BF
:10FEC000445F524154453D313135323030004C456C
:10FED000443D4230004C45445F53544152545F46C8
:09FEE0004C41534845533D3300E9
:02FFFE000308F6
:040000030000FC00FD
:00000001FF

File diff suppressed because it is too large Load Diff