Keil Logo

Position independent code Cortex-M3

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Author
radhwen oueslati
Posted
8-Jan-2018 15:26 GMT
Toolset
ARM
New! Position independent code Cortex-M3

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

Author
Westonsupermare Pier
Posted
8-Jan-2018 20:23 GMT
Toolset
ARM
New! RE: Position independent code Cortex-M3

The vector table contains absolute addresses, you'll need to relocate based on address the image is placed at.

Author
radhwen oueslati
Posted
11-Jan-2018 13:55 GMT
Toolset
ARM
New! RE: Position independent code Cortex-M3

Thanks for the answer.
DO you have any example ( how to do ) ?

Radhwen

Author
Westonsupermare Pier
Posted
11-Jan-2018 17:13 GMT
Toolset
ARM
New! RE: Position independent code Cortex-M3

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?

Next Thread | Thread List | Previous Thread Start a Thread | Settings

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.