DSPRelated.com
Forums

#pragma DATA_SECTION with c++

Started by theb...@excite.com July 4, 2005
hi all,
I posted a question recently on this forum and received a very helpful reply from robert(thank you). I just have another question about memory allocation. I wish to use the SDRAM on my c6416 dsk. I have written a command file for my project which I will include below and also I include the syntax I am using for C++ pragma to write a variable to SDRAM.

On compiling I get an error saying;
warning: pragma DATA_SECTION can only be applied to a file level symbol definition, not


Your email is incomplete. But for education anyways, the syntax is:
#pragma DATA_SECTION( variable_name, external section )
So you define external_section in your CMD file. This CMD file must be
included with the CMD that BIOS creates, using the l option ( I think ).
You cannot use this pragma to write a variable to SDRAM. You use it to
declare that the variable is in SDRAM. The linker will then put that
variable in the external section at link time. You should then be able to
use this variable like any other, if it works correctly.
Robert
www.gldsp.com
_____

From: code-comp@code... [mailto:code-comp@code...] On Behalf
Of theblaahead@theb...
Sent: Monday, July 04, 2005 11:16 AM
To: code-comp@code...
Subject: [code-comp] #pragma DATA_SECTION with c++
hi all,
I posted a question recently on this forum and received a very
helpful reply from robert(thank you). I just have another question about
memory allocation. I wish to use the SDRAM on my c6416 dsk. I have written a
command file for my project which I will include below and also I include
the syntax I am using for C++ pragma to write a variable to SDRAM.

On compiling I get an error saying;
warning: pragma DATA_SECTION can only be applied to a file level symbol
definition, not