I made a 31 word bootloader based on Kasper Pedersens tinyloader. The reset vector points to the loader and in the loader there is a jump to the application.
How can I update the jump address in the loader? It is in the same page as the loader. If I fill the page buffer and erase the page the loader is no longer there and can't write the page buffer to the flash.
Hmm, I have an idea how Kasper might have done it. Write a temporary loader (TL) application, time out so the loader boots the TL, use the TL to write the updated loader, time out and write the actual application with the updated loader. Really really ugly if it's that way.
Only, I have stripped the loader of the time outs, using manual reset instead. For the above method that would mean 3 manual resets per application update instead of 2. Well ... it'll be only if the boot address changes. Or if application code needs to be written to the page with the loader.
Or is there a trick I missed?