Reply by estar December 20, 20112011-12-20
>On Wed, 14 Dec 2011 10:53:56 -0600, Vladimir Vassilevsky wrote: > >> estar wrote: >> >>> We need to read and write a buffer(int buf[1024]) in dsp TI memory >>> space by HPI. The host may be a simple CPU or FPGA. >>> >>> My question is: >>> My Dsp using DSP/BIOS, after copliling and linking. The address of the >>> buffer may be changed. For temporarily debugging, I can get the buffer >>> address, but I have to change my host side coding. So I want to set
the
>>> buffer address constant. Is there any ways to set the buffer address
to
>>> constant value. or are there any other good ways for this issue? >> >> If you need an object at fixed location, define it in a separate
section
>> of a linker file. > >Yup. And then you'll always have this block of memory for your linker to
>stumble around. Put it at the beginning or end of some physical section >of memory, to make life easier on your linker. Doing so will also put it
>on an even block boundary so the trailing bits of the address are all >zeros at the start of the block, which may or may not make the write more
>efficient. > >Or consider a slightly more future-proof protocol where your sender >requests an address, then writes to that address. > >-- >My liberal friends think I'm a conservative kook. >My conservative friends think I'm a liberal kook. >Why am I not happy that they have found common ground? > >Tim Wescott, Communications, Control, Circuits & Software >http://www.wescottdesign.com >
Thanks so much for the helps. I think I will try first with linker CMD file, since this is the easiest way. If the Linker command file make the linker works stumble, mayber I will try to use the simple protocol, such as DSP write the buffer address to a register of host by EMIF, then the host can read hpi by this address.
Reply by Tim Wescott December 14, 20112011-12-14
On Wed, 14 Dec 2011 10:53:56 -0600, Vladimir Vassilevsky wrote:

> estar wrote: > >> We need to read and write a buffer(int buf[1024]) in dsp TI memory >> space by HPI. The host may be a simple CPU or FPGA. >> >> My question is: >> My Dsp using DSP/BIOS, after copliling and linking. The address of the >> buffer may be changed. For temporarily debugging, I can get the buffer >> address, but I have to change my host side coding. So I want to set the >> buffer address constant. Is there any ways to set the buffer address to >> constant value. or are there any other good ways for this issue? > > If you need an object at fixed location, define it in a separate section > of a linker file.
Yup. And then you'll always have this block of memory for your linker to stumble around. Put it at the beginning or end of some physical section of memory, to make life easier on your linker. Doing so will also put it on an even block boundary so the trailing bits of the address are all zeros at the start of the block, which may or may not make the write more efficient. Or consider a slightly more future-proof protocol where your sender requests an address, then writes to that address. -- My liberal friends think I'm a conservative kook. My conservative friends think I'm a liberal kook. Why am I not happy that they have found common ground? Tim Wescott, Communications, Control, Circuits & Software http://www.wescottdesign.com
Reply by Vladimir Vassilevsky December 14, 20112011-12-14

estar wrote:

> We need to read and write a buffer(int buf[1024]) in dsp TI memory space by > HPI. The host may be a simple CPU or FPGA. > > My question is: > My Dsp using DSP/BIOS, after copliling and linking. The address of the > buffer may be changed. For temporarily debugging, I can get the buffer > address, but I have to change my host side coding. > So I want to set the buffer address constant. > Is there any ways to set the buffer address to constant value. or are there > any other good ways for this issue?
If you need an object at fixed location, define it in a separate section of a linker file. VLV
Reply by Andreas Huennebeck December 14, 20112011-12-14
estar wrote:

> We need to read and write a buffer(int buf[1024]) in dsp TI memory space > by HPI. The host may be a simple CPU or FPGA. > > My question is: > My Dsp using DSP/BIOS, after copliling and linking. The address of the > buffer may be changed. For temporarily debugging, I can get the buffer > address, but I have to change my host side coding. > So I want to set the buffer address constant. > Is there any ways to set the buffer address to constant value.
Allocate the buffer on the heap(malloc or new). Do it as first instruction in main() (especially before calling any printf related function which may also allocate memory on the heap). The address will be at a fixed address, usually 8 bytes after the begin of the heap. The address of the begin of the heap is specified during link time.
> or are there any other good ways for this issue?
You could specify a special section in the memory at link time where the buffer is located. Tschau Andreas -- Andreas H�nnebeck | email: acmh@gmx.de ----- privat ---- | www : http://www.huennebeck-online.de Fax/Anrufbeantworter: 0721/151-284301 GPG-Key: http://www.huennebeck-online.de/public_keys/andreas.asc PGP-Key: http://www.huennebeck-online.de/public_keys/pgp_andreas.asc
Reply by estar December 14, 20112011-12-14
We need to read and write a buffer(int buf[1024]) in dsp TI memory space by
HPI. The host may be a simple CPU or FPGA.

My question is:
My Dsp using DSP/BIOS, after copliling and linking. The address of the
buffer may be changed. For temporarily debugging, I can get the buffer
address, but I have to change my host side coding. 
So I want to set the buffer address constant. 
Is there any ways to set the buffer address to constant value. or are there
any other good ways for this issue?

Thanks a lot.