Skip to main content
fa_it
Associate III
February 21, 2006
Question

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

  • February 21, 2006
  • 4 replies
  • 842 views
Posted on February 21, 2006 at 08:16

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

This topic has been closed for replies.

4 replies

fa_it
fa_itAuthor
Associate III
February 15, 2006
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_it
fa_itAuthor
Associate III
February 15, 2006
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 III
February 17, 2006
Posted on February 17, 2006 at 03:25

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

fa_it
fa_itAuthor
Associate III
February 21, 2006
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