Implement a virtual bootloader section

- patch reset vector while programming flash page0
  Let the reset vector always point to the twiboot start.
- Use another (must be unused!) ISR vector to store the original
  reset vector as jump to the application.
- Cache the values for the verification read
- currently works only for devices < 8kB flash (2 byte vector entries)
- using a attiny85 as target

This change is heavily based on the optiboot bootloader.
This commit is contained in:
Olaf Rempel
2020-10-26 18:54:00 +01:00
parent 9f3781a3eb
commit f4952aaa63
2 changed files with 91 additions and 3 deletions

View File

@@ -67,7 +67,7 @@ AVRDUDE_MCU=t85
AVRDUDE_FUSES=lfuse:w:0xe2:m hfuse:w:0xdd:m efuse:w:0xfe:m
BOOTLOADER_START=0x1C00
CFLAGS_TARGET=-DUSE_CLOCKSTRETCH=1
CFLAGS_TARGET=-DUSE_CLOCKSTRETCH=1 -DVIRTUAL_BOOT_SECTION=1
endif
# ---------------------------------------------------------------------------