svchamlian svchamlian

MCF5282 Position-Independent Code

Discussion created by svchamlian svchamlian on Apr 11, 2008
Latest reply on Apr 11, 2008 by Bryan Kattwinkel


I am trying to achieve the following scheme on the MCF5282.

  1. Internal Flsah: Sector 0 (16KB): Boot Loader
  2. Internal Flsah: Sector 1 (16KB): Inventory and Sytem Data
  3. Internal Flsah: Sector  2 to 16 inclusively: Image A  (240 Kbytes)
  4. Internal Flsah: Sector 17 to 32 inclusively: Image B (240 Kbytes)

When the system boots up, the BootLoader checks a byte in Sector 1 at a specific address and, based on the value read at a specific address (say 1 or 0),  decides to jump to Image A or Image B.

Thus, I will burn:

  1. Image A starting address 0x0000 8000
  2. Image B starting address 0x0004 4000

The Data of both Image A and B will be in SRAM at specific address.


  1. Is this scheme possible?
  2. There is very little explanation in “CodeWarrior Build Tools Reference ColdFire Architectures Edition” manual on the Position-Independent Code. Very vague and unclear. Is there more explanation on this Position-Independent Code and data?
  3. How do I set up my linker file for Image A and Image B to be address independent? In other words, I don’t want to have a specific linker file for Image A and a specific linker file for Image B but rather a “generic” linker file for both. Is it possible?
  4. This “generic” linker file should therefore specify the Data that will be at fix address in SRAM. Nevertheless, the address of a) Vector table, b) Constants and c) code, should be relative to the stating address of the image in Flash.

Is this feasible?




Message Edited by SVC1 on 2008-04-11 03:58 PM