DSPRelated.com
Forums

Problem with #pragma DATA_SECTION

Started by Vladimir Matvejev May 14, 2007
Hello friends,
I have a problem with allocation of variables, all global variables (arrays) that I declare and then put into SDRAM using
#pragma DATA_SECTION (fjac, "SDRAM");
double fjac[15954];
go into FLASH memory, because their addresses begin from 0x64000000. I have checked that, memory map setup correctly in cdb (bios configuration) file. I'm using TMS320C6416T DSK, where SDRAM begins from 0x80000000. Looked in build options.
The function that I'm implementing is working in project without DSP/BIOS (every thing works well, global variables placed into SDRAM) and I have just copied the code of it into another project that is using DSP/BIOS.
Thank You for your time!
Good luck,
Vladimir

---------------------------------
Sucker-punch spam with award-winning protection.
Try the free Yahoo! Mail Beta.
Vladimir,

There is nothing magic about the name 'SDRAM'.
That is just a type of hardware RAM.

To actually put the variables in RAM, the .cmd file must have a line that defines
(your) SDRAM from (your) #pragma as being located in a RAM memory segment.

So the .cmd file needs two specific lines (amongst many others)
one defines a memory segment as being located at a RAM area and having a length long enough to hold
the table (double fjac[15954]) that you specified.
two defines the .SDRAM data segment as being loaded into the above defined memory segment.

So, the problem is an incomplete .cmd file.

R. Williams

---------- Original Message -----------
From: Vladimir Matvejev
To: c...
Sent: Mon, 14 May 2007 13:37:36 -0700 (PDT)
Subject: [c6x] Problem with #pragma DATA_SECTION

> Hello friends,
> I have a problem with allocation of variables, all global variables (arrays) that I
> declare and then put into SDRAM using #pragma DATA_SECTION (fjac, "SDRAM"); double fjac[15954];
> go into FLASH memory, because their addresses begin from 0x64000000. I have checked that,
> memory map setup correctly in cdb (bios configuration) file. I'm using TMS320C6416T DSK,
> where SDRAM begins from 0x80000000. Looked in build options. The function that I'm
> implementing is working in project without DSP/BIOS (every thing works well, global
> variables placed into SDRAM) and I have just copied the code of it into another project
> that is using DSP/BIOS. Thank You for your time! Good luck, Vladimir
>

------- End of Original Message -------