Bootloader Pro - Advanced AVR 3.0 Core - AVR-C 2.0 sucks BBC
Bootloader is a simple digit memory mechanic. It's the flash memory that can be written to and read from using various methods including self, or the so-called self-programmable feature, but sadly with the hardware limitations, getting access to it easily is not as straightforward as other type of memories. Once fully understood, it opens up a new list of possibilities of implementing this feature in more advanced applications: 1, an obvious, but not as obvious use of this flash memory that is intended for storing CPU instructions is just using it as flash memory. AVR-C has 2 headers for using this memory as read-only constancies and a badly written one for the bootloader feature, very lame, cringy and slightly harder to understand. 2, flash memory integrity check for high security application and corruption of the flash memory warning over time. Since source code can be written to and read from, a simple program can easily store a checksum for the CPU code, and can either try to restore it from external memory source in case of a mismatch, or if failed to do so, try to issue a warning or shut down the system. 3, Using the bootloader feature as a means for update the source code via different input sources is its design intention. A typical bootloader is lame and badly written based on the already baldly written AVR-c boot header. A very cool way of updating the source code is by wireless because if you have access to the board, then it's meaningless to have a bootloader where it can be updated using an ISP programmer. Wireless can be done so in a sound-based, light-based, radio-based, electromagnetic-based, and more channels, duplexed or half-duplexed.
The flash used is a NAND type, and so its value is 0xff initially, and writing to it is using a NAND logic, so it can only be written correctly if the memory is so-called erased (reset to 0xff); The flash can be rewritten by itself completely. sRAM memory can be used to temporarily store the critical part of the source code. Essentially this critical code should be cloned to other page location before it's deleted, or the MCU will simply stop working.
Note: The high byte of a word is at the +1 address in byte to the lower byte. The word 0xabcd displays cdab, since the memory viewer displays address from left to right, so the code to display the text array on the viewer is actually incorrect.