cancel
Showing results for 
Search instead for 
Did you mean: 

Building application memory independent for IAP application

Suriya One.Zero
Associate II

I am working on IAP boot-loader where the user application store either in 2 sector in which update comes in other sector respect to the current sector. So I need to build user app memory independent but I don't know how to do it. Could someone help?

3 REPLIES 3

The compiler should have options to generate more "address independent" code, and the linker can output object files which can be loaded and relocated in memory.

One of the problems with the Cortex-M is that the vector table contains absolute addresses, so even if all the other code is independent you'll still need to resolve the vector table addresses.

One experiment you can do is build two binary images at different addresses and then do a file compare to confirm the only fixed addresses where within the vector table. If that is the case the vector table can then be adjusted as part of the flash update process depending on where you are placing the application.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Yeah I tried address independent option in keil linker option but the start up program file show error when I compile.

I also tried your experiment suggestion and yes the address are changing at some specific byte location example app build at 0x08020000 is having byte value of 0x02 at many places and app build at 0x08060000 is having byte value of 0x06 at the same place where 0x02 is placed. So How will I change it?