cancel
Showing results for 
Search instead for 
Did you mean: 

How to define a Data segment, for placing data in Ext. ram?

fa
Associate II
Posted on February 21, 2006 at 08:16

How to define a Data segment, for placing data in Ext. ram?

4 REPLIES 4
fa
Associate II
Posted on February 15, 2006 at 04:27

I am using the IAR compiler..

I have an External RAM where I want to place only certain data..

I think I have to use segments and #pragma, but what to write in the Linker xcl file?

Best regards,

Frank Andersen

fa
Associate II
Posted on February 15, 2006 at 05:05

I want to place code in flash, data for OS and buffers for USB in internal ram, and data large data structures in external ram.

Best regards, Frank Andersen

aialinux
Associate II
Posted on February 17, 2006 at 03:25

I face the same problem. I don't know how to do.

fa
Associate II
Posted on February 21, 2006 at 08:16

Thx,

To use the #pragma location

You have to define the segment eg. EXTRAM in the linker file, like this:

-DSRAMSTART=0x60000000

-DSRAMEND=0x600FFFFF

-Z(DATA)EXTRAM=SRAMSTART-SRAMEND

To declare a variable in the segment ''EXTRAM'' do:

#pragma location=''EXTRAM''

__no_init long ExtMem;

Best regards, Frank Andersen