Hi All,
I am implementing a software upgrade mechanism (burning a new image into a flash memory area).
The problem: I don't know how to change the load region address at runtime.
Flash contains booter and application Additionally I allocated an area for new sw application on the same flash. After burning the new sw into the allocated area on the flash, I want to run the new sw instead of the old one.
Booter already knows how to jump to the new code in the flash. The problem is that new and old code are both compiled with the same scatter loading region mapping, so when i run the new code from the new address it still uses the "old" scatter loading region, i.e. it loads my old code.
Is there a way of setting the LR address to be relative and not absolute.
Of course i can compile the new SW with new scatter mapping, but this doesn't help me, because i don't know if it will run as a "new" or "old" image.
Thanks in advance
Hi,
I would like to rephrase my question.
I’m using arm926ej-s chip which has a three steps boot sequence: 1st step - Primary bootloader (I call it “ROM Boot”) factory supplied, on a non-volatile memory area. 2nd step - Secondary bootloader, on flash memory area. 3rd step - Final Application, on flash memory area.
I’m using the ARM “fromelf” utility to translate the ELF image into suitable binary to be used later on with “mergebin” tool to combine different images into a single file to be loaded into flash memory. Vector Table is being copied from application (flash memory area) into RAM region defined through a scatter file for steps 2 and 3 individually.
Assuming the flash burnt with the following contents: Secondary bootloader. Two final application copies “A” and “B” (via “mergebin” or secondary bootloader which capable of accepting a new image via UART and write it to flash)
and assuming the secondary bootloader knows “A” and “B” entry point addresses so it can branch to there – the problem is that “A” and “B” images created using the same scatter file thus both has the same load region base address. So it does not matter which final application the secondary bootloader is branch to – the scatter loading stage of both will always start from the same flash absolute address which is wrong.
My question is how to avoid that? Maybe there is another approach to achieve my goal of being able to run the same application from different place?
Thanks, Ronen
FYI: mergebin is something proprietary. merge bin is a tool which combines bootloader and application and combines them into a single binary executable. Gopala
What is typically done is an update of the internal flash region that is dedicating to hosting the latest firmware. There is no reason to jump to 2 different locations; keep the alternate image aside, and program it upon need. In other words: you complicate the issue at hard tremendously.