I'm looking for some ideas (or solution) to the following problem :-
1. I using an STM32F207VG and I want to operate from 2 x separate code executables. An "old" version, and the "new" uploaded version. 2. Loading a binary executable to the upper-half of the FLASH (0x0808 0000) from an old dongle is easy. That's not the problem. 3. The problem lies in "reseting" to start execution from 0x0808 0004 (and not from 0x0800 0004). 4. I really don't see a way around this other than to copy the "new" executable code over the default FLASH boot space (0x0800 0000). 5. I've searched the Cortex-M3 manual and there is no register whereby you can change the default reset vector (i.e. from 0x0800 0000) to another value. Unless it's hidden. 6. Using a FLASH based "system memory bootloader" IAR is not an option. 7. That should make some sort of sense, if not, then I haven't explained it very well.
All positive comments and ideas are most welcome.
I'm not sure what you meant by point 6, but in my view there has to be some kind of a ROM monitor (a bootloader or whatever you want to call it.) It would be the first to run after reset and decide which of the two programs should be allowed to run. By the way, this functionality can be incorporated into the app that resides in lower part of the flash (or both.)
Hi Mike,
Yes I agree, there has to be some sort of ROM-Monitor/Bootloader function that runs immediately after reset. I was looking for a cheat in order to make this very simple (i.e. on uploading a new executable, issue a reset that vectors "here" as opposed to "there"). That way the binary that has just be uploaded starts execution from RESET.
My issue is that on a reset, the ROM-monitor/bootloader function that is executed will ALWAYS be the one in the LOWER part of the FlASH. Do you agree ? Is that a valid concern ?
I'm just wondering out loud because I'm going into unknown territory.
Any other suggestions or comments or hints are most welcome.
Best, Rich.
You should have 3 memory regions. A small boot loader, and two application areas. And possibly letting the boot loader compute CRC on the memory regions to verify that the one flagged as "new" isn't corrupt.
View all questions in Keil forum