ARM Technical Support Knowledge Articles

LOCATING PROGRAM SECTIONS TO SPECIAL MEMORY AREAS

Applies to: C166 C Compiler

Answer


Information in this article applies to:


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 uVision 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

Article last edited on: 2008-05-05 02:12:43

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential