We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
We are using LPC1756(256K flash, 32K RAM). We need two application images which runs in flash to support in service upgrading. That is, the running application itself can download another version of it into another address in flash. This has to require us to build so-call Position Independent (PI) code without need to specify the absolute starting address when building in Keil. Keil does support PI, however the problem we are facing is that the code cannot be built successfully if startup.s is included. We do need startup.s because we need the interrupt vector table in it (it is the interrupt vector table that prevents the compiler/linker from building it).
Anybody knows if there is a solution for this? Any share of real practice or idea will be appreciated.
Is the startup file in assembler (in which case it isn't affected by any compiler switches) or in C?
You might consider rewriting your startup file to make it position-independent.
Or you might consider building two sets of binaries - if you add your own download functionality, that functionality can accept an upgrade file that always contains two non-PI images and select the relevant binary depending on if it's the low-address or high-address copy that is currently running.