- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
we have developed your prototype board using LPC4088 and CY62157EV30LL-45ZSXI.
In our project we are using LCD for display process data.
LPC4088 having internal LCD controller hence we have mapped frame buffer on external chip CY62157EV30LL-45ZSXI at address 0x90000000.
All LCD buffer read and display fine without any problem.
In external memory CY62157EV30LL-45ZSXI we mapped data as :
.data.$RAM5.SRAM
0x90000000 0x4b000 ./Config/LCDConf.o
0x90000000 _aVRAM
and at lower region on External memory CY62157EV30LL-45ZSXI , we mapped data structure at location 0x9007A000.
data structure is as below:
//___________________________
typedef struct Data_A1_SCom
{
unsigned short Id;
long Val;
long Utl;
long Ltl;
}Data_A1_Com;
typedef struct Data_A1_SRes
{
unsigned char Time[10];
long Val_Arr[200];
}Data_A1_Res ;
typedef struct Data_A1
{
unsigned char Header[20];
unsigned short Total_Commands;
unsigned short Total_Results;
Data_A1_Com Command[200];
Data_A1_Res Result[100];
}DATA1_Seq;
//______________________________________________
DATA1_Seq*Ptr2Meas_Seq = 0x9007A000; //Defined pointer
We access structure members using Ptr2Meas_Seq and We successfully write and read structure members.
But when we clear LCD by writing buffer "0x90000000" to zero then automatically our data structure member becomes zero and we lost data in structure.
If we write structure without clearing LCD then it is working fine, but when we clear LCD buffer after writing data structure member then it become zero.
While accessing SRAM upper region if we try to write lower region of SRAM then it is corrupted.
Means if we write value at SRAM at location 0x90000000 then, our data structure at location 0x9007A000 corrupted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Could you please let us know, how you are allocating memory for structure "DATA1_Seq" at location 0x9007A000?
Please share the code for structure declaration also.
Thanks and Regards,
Sudheesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Sudheesh,
Thanks for quick response.
We allocating structure in SRAM by using Manual method ( no malloc/memory allocation function used).
We made address map of SRAM and allocating variable at different location of SRAM.
We are defining structure pointer to access members of structure then use index to access member of it:
DATA1_Seq *Ptr2Meas_Seq = 0x9007A000; //Defined strcture pointer "Ptr2Meas_Seq" and pointing to address 0x9007A000
Ptr2Meas_Seq[0].Total_Commands =5; //Example 1
Ptr2Meas_Seq[2].Total_Results=10; //Example 2
and structure declaration is:
//___________________________
typedef struct Data_A1_SCom // Nested structure 1 - Data_A1_Com
{
unsigned short Id;
long Val;
long Utl;
long Ltl;
}Data_A1_Com;
typedef struct Data_A1_SRes // Nested structure 2 - Data_A1_Res
{
unsigned char Time[10];
long Val_Arr[200];
}Data_A1_Res ;
typedef struct Data_A1 //Main structure ( contain both nested structures 1 and 2)
{
unsigned char Header[20];
unsigned short Total_Commands;
unsigned short Total_Results;
Data_A1_Com Command[200];
Data_A1_Res Result[100];
}DATA1_Seq;
//______________________________________________