Keil Logo

C166: LOCATING PROGRAM SECTIONS TO SPECIAL MEMORY AREAS


Information in this article applies to:

  • C166 All Versions

QUESTION

I want to locate several sections from different modules to a special ROM area. What is the best way to do that?

ANSWER

The Keil C166 toolchain offers several ways to locate sections.

One way is to add the sections you want to locate at specific addresses in µVision under Options for Target - L166 Locate - User Sections. When you enter:

?PR?FLASH%FCODE(0x6000),?HC?FLASH%HCONST

the linker locates ?PR?FLASH%FCODE at address 0x6000 and ?HC?FLASH%HCONST follows at subsequent addresses.

Another way is to use the RENAMECLASS directive at the C166 Compiler level. To do that, you must include the following pragmas into the C source files that require special placement:

#pragma RENAMECLASS (FCODE=FCODE1)
#pragma RENAMECLASS (HCONST=HCONST1)

Then the C166 compiler will use the class names FCODE1 and HCONST1 for the code and constants stored in this module. And, you can enter these class names under Options for Target - L166 Locate - User Classes: FCODE1 (0x6000-0x7FFF), HCONST1 (0x6000-0x7FFF). This locates the classes FCODE1 and HCONST1 into the address range 0x6000-0x7FFF.

MORE INFORMATION

SEE ALSO

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Monday, May 5, 2008


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  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.