Remix.run Logo
mananaysiempre 2 days ago

This kind of update is often kind of ass to do, though, because you may not be able to execute from said flash while you’re updating it.

So you copy a small write routine into RAM, copy a chunk of new data there too, jump to the routine, then it returns to your main bootloader in flash which receives the next chunk from a UART or whatever (because of course it doesn’t fit into RAM all at once), rinse and repeat. You aren’t exactly going to be serving realtime interrupts during this.

(So if you do need minimal downtime, you probably have dual external flash chips, or even just two microcontrollers given execute-from-external-flash would bump you up to fancy micros.)