Dual boot Optiboot DX #510
Replies: 2 comments 2 replies
-
Just an Idea, but how big are your programs? If they fit in Half the Flash, it might be possible to use the upper half of the Flash as the Memory Buffer (instead of an external Flash) and make the bootloader copy the upper half to the lower half. A brainstorm ASM for 128k chips (ASM cause optiboot_dx is more ASM then C anyway at this point): ldi r30 0x00 This gives us 48 bytes. if optiboot_dx isn't using the erase function, this should fit in. Needs an entry condition though, like if there was a softwareReset, check GPR3 for 0xA5, if true, copy the Flash. @SpenceKonde What do you think about this idea? |
Beta Was this translation helpful? Give feedback.
-
I think i've come up with a crazy idea of how to solve this issue, especially, since #512 is also asking for that. Basically, what you need to do is to specify the upper half of your Flash memory as APPDATA. Your App will need a function that: The following code will copy all data from the upper half to the lower half, starting from 0x200 and soft-reset. This circumvents the problem of the limited space we have in the bootloader and the question about the entry condition (no entry condition needed) And it does not create any additional Flash wear, as we're using different "banks". However, as I don't have a way of testing, this is basically just theory. I can (I hope) provide a ready-to-use Microchip Studio Project for compiling the Bootloader if it helps. @SpenceKonde I think this could be a useful feature to have in the bootloader, especially as the avrdude flash erase won't be implemented. Or did you have any other plans on how to use the 60 bytes that are left right now?
|
Beta Was this translation helpful? Give feedback.
-
Hi there,
Seems like urboot won't be adopted to AVR Dx soon. There's this nice dual boot feature, where an external SPI flash is checked for valid code which is then flashed onto the µC.
As I'm planning to replace the old ATmegas with DDs or DBs in new designs, is anyone aware of such functionality in a fork of Optiboot DX or another Dx bootloader? Or do you know of an urboot port to Dx maybe in the making?
Thanks,
Flössie
Beta Was this translation helpful? Give feedback.
All reactions