面是程序的部分代码(EMIF配置部分没有贴出来)
其实就是写进SDRAM去再读出来。
void main()
{
Uint32 i;
Uint8 check = 0;
CSL_init();
EMIFA_config(&emifaCfg0);
for(i=0;i<0x100;i++)
{
*((Uint8*)(SDRAM1_BASE+i)) = i;
}
for(i=0;i<0x100;i++)
{
check = *((Uint8*)(SDRAM1_BASE+i));
if(check!=i)
{
for(;; )
{
printf("wrong number is %d\n",i);
break;
}
}
}
printf("SDRAM1 all right\n");
}
输出的错误情况如下:
wrong number is 16
wrong number is 24
wrong number is 48
wrong number is 56
wrong number is 80
wrong number is 88
wrong number is 112
wrong number is 120
wrong number is 144
wrong number is 152
wrong number is 176
wrong number is 184
wrong number is 208
wrong number is 216
wrong number is 240
wrong number is 248
SDRAM1 all right。