Quantcast
Channel: 数字信号处理器 (DSP) & ARM® 微处理器
Viewing all articles
Browse latest Browse all 21822

帖子: DDR3地址线读写出错,内存读写不出错

$
0
0

我的板子一片C6678外挂了4片三星公司的DDR3,最近参考DDR3初始化手册更改一下初始化参数,在进行DDR3读写测试的时候,发现地址线读写出错,而DDR3内存读写正确,百思不得其解,希望大神能够帮忙分析一下,下面是我改写的测试代码,不知道有没有什么问题。

int DataPatternTest(unsigned int uiStartAddress, unsigned int uiCount, unsigned int uiStep) {  unsigned int i, j;     volatile unsigned long long *ulpAddressPointer;     volatile unsigned long long ulReadBack;   for(i = 0; i < PATTERN_SIZE; i++)  {   /* Write the pattern */   ulpAddressPointer = (unsigned long long *)uiStartAddress;   for(j = 0; j < uiCount; j++)   {    *ulpAddressPointer = ulDataPatternTable[i];    ulpAddressPointer += (uiStep);   }   /* Read back the data*/   ulpAddressPointer = (unsigned long long *)uiStartAddress;   for(j = 0; j < uiCount; j++)   {    ulReadBack = *ulpAddressPointer;    if(ulReadBack != ulDataPatternTable[i])     return 0;    ulpAddressPointer += (uiStep);   }  }  return 1; }  int AddressTest(unsigned int uiStartAddress, unsigned int uiCount, unsigned int uiStep) {  unsigned int i;  volatile unsigned long long *ulpAddressPointer;  volatile unsigned long long ulReadBack;   ulpAddressPointer = (unsigned long long*)uiStartAddress;  for(i = 0; i < uiCount; i++)  {   /* fill with address value */         *ulpAddressPointer = _itoll(((unsigned int)ulpAddressPointer)+4,(unsigned int)ulpAddressPointer);         ulpAddressPointer += (uiStep);  }  ulpAddressPointer = (unsigned long long*)uiStartAddress;  for(i = 0; i < uiCount; i++)  {   ulReadBack = *ulpAddressPointer;   if(ulReadBack != _itoll(((unsigned int)ulpAddressPointer)+4,(unsigned int)ulpAddressPointer))    return 0;   ulpAddressPointer += (uiStep);  }  return 1; } 

Viewing all articles
Browse latest Browse all 21822

Trending Articles