Hi Frank,
It is already done in the attached code in the thread. The initialization of EMI lines are done in the startup function inside SystemInit() - >Chip_SystemInit()->EMC_SetPinMux() & EMC_SetupSDRAMMemmory()
Also I verified it by using below code modification in the attached reference code.
#define SDRAM_SIZE_BYTES (2* 1024 * 1024)
#define SDRAM_SIZE SDRAM_SIZE_BYTES
__BSS(RAM8) uint16_t Buffer[SDRAM_SIZE_BYTES ];
__BSS(RAM9) uint16_t Buffer1[SDRAM_SIZE_BYTES ];
void main(void)
{
uint32_t l_ui_Count = 0;
uint8_t l_ui8_status = 0, l_ui8_status1 = 0;
/* Writing the data in SDRAM RAM*/
for(l_ui_Count = 0; l_ui_Count < SDRAM_SIZE; l_ui_Count++ )
{
Buffer[l_ui_Count] = 0x5555;
Buffer1[l_ui_Count] = 0xA5A5;
}
/* Reading the data from SDRAM and verification of the same */
for(l_ui_Count = 0; l_ui_Count < SDRAM_SIZE; l_ui_Count++ )
{
if(Buffer[l_ui_Count] != 0x5555)
{
l_ui8_status = 1;
}
if(Buffer1[l_ui_Count] != 0xA5A5)
{
l_ui8_status1 = 1;
}
}
while(1)
{
if(l_ui8_status == 0 && l_ui8_status1 == 0)
{
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++ );
}
else
{
Chip_GPIO_SetPinState(LPC_GPIO_PORT, 5, 19, (bool) false);
}
}
return 0 ;
}/* Main()*/
Refer the attached code in the thread and revert. after doing this it is working properly but same modification is done in the main code there it is not working. the only difference is instead of Buffer array I am assigning Structure array to it.
Also the variables of different data types are there uint8_t, uint16_t, uint32_t son checking the same issue also I am using memcpy function for copying the data to it.
Just suggest if have pointers mean while I will check at my side.
BR,
Gaurav More