I have been looking a while, but I'm not sure how to handle this case. I have a small boot program that I wrote that I load at 0x00000000. It runs fine, and from that program, I want to either jump to main code at 0x8000 or 0x14000. The idea is that I would always have a known good version on the device, but could upgrade the software in the other bank, and use that on boot. The main reason I have my own boot loader is that I'm doing the updating via a proprietary interface, not serial, usb, etc.
I have the boot program selecting the code at 0x8000 and running it correctly. This main code has been compiled with the .cmd file telling it that it's loading at 0x8000. From a practical standpoint, it doesn't make sense to have two different compiled versions each assuming they are loading at different address, especially since I don't know which bank will me upgraded next. The boot software is going to load new code into the bank that doesn't contain the last known good version.
How do I get around this? I have loaded the same main code into 0x8000 and 0x14000, and the boot loader will run either one, but for example, if I deleted the code at 0x8000, it would not run the code at 0x14000.
This seems like a fairly common use case, so there must be a way to tackle it that I haven't found.
-James