Hello,
I want to generate a code that is address/position independant.
The objective is to download and execute the same code in both stm32 banks using Keil.
Could you please explain me step by step how to do ?
Thanks in advance Radhwen
The vector table contains absolute addresses, you'll need to relocate based on address the image is placed at.
Thanks for the answer. DO you have any example ( how to do ) ?
Radhwen
It is not something I can explain in five minutes or less, and I'm not compensated in a way that allows for me to work on your project.
Experience with the construction of linkers, loaders and object files would be helpful, along with how the micro-controller functions. Perhaps someone within your team or group has some experience you can use on the project.
Do you understand where the vector table is located in the image you are writing to flash?
Do you understand the content of the vector table entries, and what they point to?
Can you selectively add an offset/basis to those entries as you write that block of data into flash memory when you write it to an address that differs from the one you linked it at?
I understand where the vector table is located.
But it's not enough to change the vector table. I can change the vector table in real time depending on the bank i want to execute the code, but the most important is how to do at project options so that the compiler does not take the address introduced on the linker in consideration.