Optiboot / optiboot

Small and Fast Bootloader for Arduino and other Atmel AVR chips
Other
1.08k stars 396 forks source link

optiboot_x: "SPM Service" probably doesn't work. #293

Open WestfW opened 3 years ago

WestfW commented 3 years ago

The vector for allowing Application code to call the bootloader is essentially unimplemented in optiboot_x for mega0 and xtiny chips. Since the NVM Controller in these operates much differently than traditional AVRs, the port may be "interesting."

WestfW commented 3 years ago

This is complicated. On older AVRs, writes to flash were all manipulated using the SPMCSR register and SPM instruction, so the Optiboot support for SPM consisted of setting the SPM contents (with a limited number of legal values) to the passed value and executing the SPM instruction. The new chips are more statefull..

Note: can an application do STores to the flash memory alias space if the bootloader executes the actual NVMCTL commans?

(also note mega0 and AVR-DA are different from one another.)