This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

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

Other Parts Discussed in Thread: TMS320C6678

我的板子一片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;
}
  • 需要根据DDR3 leveling 表格计算您单板上的DDR3具体参数,

    然后将获得参数配置到您的DDR3初始化代码中去。

    DDR3 leveling工具和表格下载请参考C6678 主页:

    http://focus.ti.com/docs/prod/folders/print/tms320c6678.html