2.2 Boot, Application Code, and Application Data Section

It is not possible to write to the section of flash the code is currently executing from. Code writing to the application code section needs to be executing from the boot section, and code writing to the application data section must be executing from either the boot section or the application code section. How large each of the respective sections are is defined by the fuses. There is one BOOTEND fuse and one APPEND variable that control this.

When BOOTEND is zero, the entire Flash is considered to be boot section, the value in APPEND is ignored, and it is not possible to write to Flash.

When BOOTEND is non-zero, the default location of the interrupt vector table pointer will be written to the start of the application code section by default. If no bootloader is used and the interrupt vector is not moved, it is possible to overwrite this by changing the IVSEL bit in the CPUINT_CTRLA register. If the IVSEL bit is changed, the interrupt vector will be pointed to the start of the bootloader section.