может это поможет:
Absolute placement (v.5.xx) (in C source)или это
Absolute placement (v.5.xx) (in assembler source)Technical Note 36121
Absolute placement (v.5.xx) (in C source)
EW targets: ARM
EW component: C/C++ compiler
Keywords: "@" / #pragma locate, absolute address
Last update: July 9, 2008
Background - general
There are major changes in the EWARM between version 4.x and version 5.x. The link to the right gives some more information.
Background - specific
Initializers are no longer allowed for absolute placed constants, which means the following type of C/C++ construction is no longer allowed:
int const a @ 10 = 20;
Problem
There is no way of express the above in an output file in the elf/dwarf format.
Solution
The solution consists of two changes.
In the .c file place the variable in a named segment. In the .icf (for the linker) place the segment at a specific location.
The C source can have looked like this in 4.xx:
const char RELEASEDATE[16] @ 0x0000FF10 = __DATE__ ;
const char RELEASETIME[16] @ 0x0000FF20 = __TIME__ ;
This will be changed to this in the .c file in 5.xx:
#pragma location = "ConstSection1"
__root const char RELEASEDATE[16] = __DATE__ ;
#pragma location = "ConstSection2"
__root const char RELEASETIME[16] = __TIME__ ;
In the .icf file are these lines added:
place at address mem: 0x0000FF10 { readonly section ConstSection1 };
place at address mem: 0x0000FF20 { readonly section ConstSection2 };
The Ilink will then place the sections ConstSection1 at address 0x0000FF10, and the section ConstSection2 is placed at address 0x0000FF20.
Migration
It is also highly recommended that you have a look at the "The migration process" in the above guide. This will give you a good picture of what has to be done to migrate from version 4 to version 5 of the ARM IAR Embedded Workbench.
Technical Note 17934
Absolute placement (v.5.xx) (in assembler source)
EW targets: ARM
EW component: Assembler
Keywords: "@" / #pragma locate, absolute address
Last update: February 29, 2008
Background - general
There are major changes in the EWARM between version 4.x and version 5.x. The link to the right gives some more information.
Background - specific
The concept of "absolute placement" is removed from the Assembler in EWARM 5.xx.
Problem
The old (v.4.xx) directives for absolute placement (ORG, ASEG+address and ASEGN) are not available in EWARM 5.xx.
Solution
The assembler can place CODE and CONST in named segments. The linker can place the named segments at specified locations.
The assembler source can look like:
NAME get
PUBLIC get42
PUBLIC jjj
SECTION `.my_rodata`:CONST:NOROOT(2)
jjj:
DATA
DC32 42
SECTION `.my_text`:CODE:NOROOT(2)
THUMB
get42:
LDR R0,get42_0 ;; jjj
LDR R0,[R0, #+0]
BX LR ;; return
Nop
DATA
get42_0:
DC32 jjj
END
This will direct CONST to the segment .my_rodata and CODE is directed to the segment .my_text
In the .icf (Ilink control file) are these lines added:
define symbol _my_CODE__ = 0xEEBB0000;
define symbol _my_DATA__ = 0xAA110000;
place at address mem:_my_CODE__ { readonly section .my_text };
place at address mem:_my_DATA__ { readonly section .my_rodata };
The Ilink will then place the section .my_text at address 0xEEBB0000, and the section .my_rodata is placed at address 0xAA110000.
Migration
It is also highly recommended that you have a look at the "The migration process" in the above guide. This will give you a good picture of what has to be done to migrate from version 4 to version 5 of the ARM IAR Embedded Workbench.