Keil™, An ARM® Company

Technical Support

ARMCC: PLACING CODE AT A FIXED ADDRESS


Information in this article applies to:

  • MDK-ARM All Versions

SYMPTOM

How can I place a piece of code, or constant data, at a fixed location in my program's binary, using the RealView toolchain?

CAUSE

The RealView toolchain differs from the CARM toolchain, in the mechanism used to explicitly place code.

RESOLUTION

To place code or constants at a specific location:

  1. Declare a new ROM space in the Options for Target — Target setup page. This new declaration should start at the address where you want your code or constant to begin. For example:
           Start:      Size:
    ROM1   0x00020000  0x00001000
    
  2. Put the code or constant data you want to place, in a separate source file.
  3. Right-click the source file name to open the Options dialog for that source file. In the Memory Assignment group, set the Code/Const box to the ROM space you just declared. In this case, ROM1.

STATUS

Supported in current version.

Last Reviewed: Tuesday, August 01, 2006


Did this article provide the answer you needed?
 
Yes
No
Not Sure