I am using a SAM4C32 and I don't think I understand how the dual banks of flash memory work in terms of how you need to compile and link if you want to use the two banks ti run two separate firmware images.
As far as I see it, you can have your bootloader built into the main program and don't need a separate bootlader. So you can habve a program running in bank 0, it can program a new image into bank 1 and then switch to bank 1 when it has received a verified image. Then when you want to upgrade again, you are running bank 1's program which erases and programs bank 0 and when that is verified you switch back to bank 0 and so on,
If you have a program running in Bank 0 and that program receives a new image for Bank 1, the address of bank 1 starts at 0x1100000, whereas the code running in bank 0 starts at 0x1000000. So, if you want to run code in bank 1, does that mean at compile time, you have to specify that the code is to run in bank 1?
If that is the case I can see an issue if a device gets out of step with updates. So, let's imagine the following:
v1.0 is compile to work on Bank 0.
v1.1 to work in Bank 1
v1.2 to work in Bank 0
What happens if a device misses v1.1 and is running v1.0 to be presented with v1.2?
What would make sense to me is that you could program into either bank and set the start address of that bank to what you want. However, it doesn't look like that is possible.
Am I missing a an important point here?