|ARM Technical Support Knowledge Articles|
Applies to: C166 C Compiler
Information in this article applies to:
I want to locate several sections from different modules to a special ROM area. What is the best way to do that?
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:
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.
Article last edited on: 2008-05-05 02:12:43
Did you find this article helpful? Yes No
How can we improve this article?