DSPRelated.com
Forums

Read from external data memoy and copy to internal memory

Started by babak vafa September 25, 2005
Hello
I have a FPGA on C5416 external data memory which there is variables (10 vector with lenght of 1024-decimal- at start address 0x8000 ) .
Also i have a internal(local) variables in my program which copy those external data variable. i mean ,first read from ext. data memory then copy to my local variables. like following
#pragma DATA_SECTION(Ext_var1,"EXDATA")
int Ext_var1[1024];
...
void main()
{
int Int_Var1[1024];

....
Int_Var1 = Ext_var1 ;
...
...
}

After execution , i could take graph at Ext_var1 and every value at this variable is ok(already i know the correct value ), but when i take graph at Int_Var1 , i get nothing and Int_Var1 is not copy of Ext_var1.
what's my wrong?
Thanks in advance




We are having a similiar issue with the C5416.
For some reason, we can't read/write to 2k of
external memory on our flash. We have 4 32k
pages, but can't write on the lower 2k on each
page.

Any ideas would be appreciated.

-Mike

--- babak vafa <moni20812000@moni...> wrote:

> Hello
> I have a FPGA on C5416 external data memory which
> there is variables (10 vector with lenght of
> 1024-decimal- at start address 0x8000 ) .
> Also i have a internal(local) variables in my
> program which copy those external data variable. i
> mean ,first read from ext. data memory then copy to
> my local variables. like following
> #pragma DATA_SECTION(Ext_var1,"EXDATA")
> int Ext_var1[1024];
> ...
> void main()
> {
> int Int_Var1[1024];
>
> ....
> Int_Var1 = Ext_var1 ;
> ...
> ...
> }
>
> After execution , i could take graph at Ext_var1 and
> every value at this variable is ok(already i know
> the correct value ), but when i take graph at
> Int_Var1 , i get nothing and Int_Var1 is not copy of
> Ext_var1.
> what's my wrong?
> Thanks in advance > c54x-unsubscribe@c54x...




It seems you're not copying the array, just the pointer. If I understand
correcrly what you're trying to do, you should replace
Int_Var1 = Int_Var1;
with
memcpy(Int_Var1,Int_Var1,sizeof(Int_Var1));

Hope I could help,
Guy Bazelet
Message: 1
Date: Sun, 25 Sep 2005 09:15:44 -0700 (PDT)
From: babak vafa <moni20812000@moni...>
Subject: Read from external data memoy and copy to internal memory

Hello
I have a FPGA on C5416 external data memory which there is variables (10
vector with lenght of 1024-decimal- at start address 0x8000 ) .
Also i have a internal(local) variables in my program which copy those
external data variable. i mean ,first read from ext. data memory then
copy to my local variables. like following #pragma
DATA_SECTION(Ext_var1,"EXDATA") int Ext_var1[1024]; ...
void main()
{
int Int_Var1[1024];

....
Int_Var1 = Ext_var1 ;
...
...
}

After execution , i could take graph at Ext_var1 and every value at this
variable is ok(already i know the correct value ), but when i take graph
at Int_Var1 , i get nothing and Int_Var1 is not copy of Ext_var1.
what's my wrong?
Thanks in advance ________________________________________________________________________
________________________________________________________________________