Hi Converse,
Thanks for the reply,
I modified the code as per ypur inputs and check the same and founf it is proper. Thansk for the help . I was not assigning values to the buffer allocated in SDRAM.
Reagrading the functionality i am facing some issue for SDRAM.
After modification I tried to check whether the buffer allocated in getting updated properly after assigning the values to buffer. Using the below mentioned code,
__DATA(RAM7) uint32_t data_buffer[512];
for (Value = 0; Value < (512); Value++)
{
data_buffer[Value] = Value+1;
}
for (Value = 0; Value < (512); Value++)
{
if(data_buffer[Value] != (Value + 1) )
{
Chip_GPIO_SetPinState(LPC_GPIO_PORT, 5, 19, (bool) false);
while(1);
}
}
while(1)
{
Chip_GPIO_SetPinToggle(LPC_GPIO_PORT, 5, 5);
for (i=0; i<0xFFFFF;i++ );
Chip_GPIO_SetPinToggle(LPC_GPIO_PORT, 5, 19);
for (i=0; i<0xFFFFF;i++ );
// for (i=0; i<0xFFFFFF;i++ );
}
As per the above code the values acpested is 1 to 513 in the buffer array but after debugging i found that the data is not updated properly. values are wrong. some location it is not writing the values it is showing zero values. and other place it is updating wrong values.
Then I performed the other test where i modified the code with below mention method,
/* Initialize code */
#define EMC_ADDRESS_DYCS0 (0x28000000)
int Main(void)
{
uint32_t *sdram = (uint32_t *)(EMC_ADDRESS_DYCS0); /* SDRAM start address. */
uint32_t index, i;
uint32_t sdramAddr;
uint32_t Data = 0XA5A5A5A5;
uint32_t Data1 = 0x5A5A5A5A;
for (index = 0; index < (SDRAM_SIZE ); index++)
{
Chip_GPIO_SetPinToggle(LPC_GPIO_PORT, 5, 5);
if(Flag == 0 )
{
sdramAddr = Data;
//*(sdram + index ) = sdramAddr;
*(uint32_t *)(sdram + index ) = sdramAddr;
Flag = 1;
}
else
{
sdramAddr = Data;
//*(sdram + index) = sdramAddr;
*(uint32_t *)(sdram + index ) = sdramAddr;
Flag = 0;
}
if(*(uint32_t *)(sdram + index ) != sdramAddr )
// if(*(sdram + index) != sdramAddr )
{
while(1);
}
}
while(1)
{
Chip_GPIO_SetPinToggle(LPC_GPIO_PORT, 5, 5);
for (i=0; i<0xFFFFF;i++ );
Chip_GPIO_SetPinToggle(LPC_GPIO_PORT, 5, 19);
for (i=0; i<0xFFFFF;i++ );
// for (i=0; i<0xFFFFFF;i++ );
}
}// Eof Main
Using this mehtod i tested the complete size of the SDRAM and fout it working properly.
please let mw know what is the issue in the code. ia have also attached the code for your reference.
Please let me know where is the mistake in the code. Since i have to allocate the data in SDRAM ram due to some memory contraints and application requirement.
Thanks
Gaurav More