[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] use of specifin RAM location

From: David Kelly
Subject: Re: [avr-gcc-list] use of specifin RAM location
Date: Mon, 28 Nov 2005 21:01:44 -0600

On Tue, Nov 29, 2005 at 08:35:05AM +1000, address@hidden wrote:
I have the same problem, and the point is that part of my external
memory is inside an FPGA, basically under control of the FPGA (It's
high-speed ADC data), while another part is external SRAM which I use
for my heap etc.

I access the FPGA memory at the moment using pointers which I initialise to the right value. I don't yet have a method mapped out for the SRAM -
it's on the next version of the board (the present version has no
external SRAM).

I will have a need to allocate some large-ish arrays in the external
SRAM in the next hardware version.

Memory-mapped peripherals need to be accessed at particular addresses
also, however these don't usually need allocation (and hence can be
accessed via pointers initialised to the correct address).

The cleanest way to pull this off would be to lay a structure on the
memory-mapped device and allocate it in a named section. See
http://gcc.gnu.org/onlinedocs/gcc-3.4.3/gcc/Variable- Attributes.html#Variable-Attributes

Then in the linking stage define the location of the FPGA something like
this in Makefile:

LDFLAGS= -Wl,-Map,address@hidden \
        -Wl,--section-start=.eeprom=0x00810001 \
        -Wl,--section-start=.fpga1=0x6000 \
        -Wl,--section-start=.hsa2d=0x7000 \

Just use the __attribute__ to tag variables as section .sram and the
compiler will find places for them if you don't care about the order.

David Kelly N4HHE, address@hidden
Whom computers would destroy, they must first drive mad.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]