Skip to main content
Suriya One.Zero
Associate II
October 3, 2019
Question

Building application memory independent for IAP application

  • October 3, 2019
  • 1 reply
  • 1138 views

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?

This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
October 3, 2019

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 VenmoUp vote any posts that you find helpful, it shows what's working..
Suriya One.Zero
Associate II
October 4, 2019

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