Bootloader: jumping to either App A or App B
Hello
I am considering the following approach of the Bootloader.
We will divide the internal flash into :
1. Bootloader
2. App A
3. App B
For App A or B we will have a version number. Bootloader will read the version numbers of both and depending upon which application is newer will jump to there. The application doesn't know in advance where it will reside- either in the App A or App B section, which means we're talking about Position Independent Code.
My compiler is Keil.
My 1st question is how can I build such a bin image that can reside in either of these 2 sections?
Another approach looks clear for me. It is to assign the bottom section to the application and the upper section to the buffer to hold the new version. When the new version is downloaded, we then copy it to the bottom and erase the buffer in the upper.
The advantage in the 2nd method is simplicity- no need in PIC. The advantage in the 1st method is speed - no need to copy image from the upper to the bottom section.
My second question is which approach is better in your view and why?
