本帖最后由 sundonga 于 2014-6-15 20:18 编辑
做了一块DSP6713的板子,在CE3空间接了一块MT48LC32M16的SDRAM,是8M*16bit*4banks的,原理图和芯片截图见附图。分配空间是不是应该这样计算,8M*16bit*4banks=64M*1byte=0x04000000*1byte。
在CE3空间定义了这样两块内存:
CE3_BOOT : origin = 0xb0000000, len = 0x400
CE3_SDRAM : origin = 0xb0000400, len = 0x03fffc00 //len=0x04000000-0x400=0x03fffc00,不知这里这样计算对不对?
用下面这段程序去验证,i的赋值是不是最多应该是0x03fffc00/4=0x00ffff00,但按下面程序所示比0x00ffff00大,最后还是Testing is success!,不知这个存储器大小应该怎么计算才是对的?
-----------------------------------------------------------------------------
Src_StartAdd = (Uint32 *)0xb0000400;
// Write data in the whole chip.
for(i=0;i<0x00ffff02;i++)
{
*(Src_StartAdd++) = i;
}
printf("\nFinish writing Source data.");
Src_StartAdd = (Uint32 *)0xb0000400;
// Read data from Dst_StartAdd.
for(i=0;i<0x00ffff02;i++)
{
TempData = *(Src_StartAdd ++);
if(TempData != i)
{
printf("\nTesting is failure!");
printf("\nAddress 0x%x is error!",i);
exit(0);
}
else continue;
}
printf("\nTesting is success!");
-----------------------------------------------------------------------------
|