SPM 3.0 writes to self - Advanced AVR 3.0 Core Bootloader
Channel:
Subscribers:
580
Published on ● Video Link: https://www.youtube.com/watch?v=M_HC3_TN1Bo
Boot macros from AVC-libc are pretty bad. Here is how it is done mainly using c and simple inline asm code. The MCU needs to access to r1:r0 and the z-register, and that is pretty much all to it, but r1 needs to be cleared once it's used since this r1 is supposed to be the so-called zero-register in AVR-c. Code size has reduced to 80 bytes while being extremely easy to read, portable and elegant. The compiled assembly code is beautiful and near perfect, and exactly the reason why writing everything in inline asm is beyond dumb.