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.

关于ddr3A部分内存无法读取得问题

Other Parts Discussed in Thread: 66AK2H14

66ak2h14

硬件方面基本参照EVM板tci6638制作,ddr3_remap_en引脚是拉高的

在自己做的板子上,是用K2_STK中的内存检测程序(dsp程序),

DDR3A内存条硬件:我分别使用EVM的2G内存条和自己买的4G内存条情况如下:(降频到1333的情况也如下)

ddr3参数配置:A,B均是采用比较稳定的相同参数  DDR3B也是4G内存条

访问ddr3b(0x6000 0000---0x7FFF FFF  512M)能够正常读写,测试没有错误。

访问DDR3A是(0x8000 0000---0xFFFF FFFF) 在回读的时候出错。

追踪发现0x8001 0000--0x8002 0000 这片空间无法读取(在程序写操作时能通过,不知道是不是真写进去了),

同时我还随机选了几段空间,0x8fff 000---0x8FFF FFFF;0X9FFF 0000----0X9FFF FFFF这个几个空间也无法读取。

0x8000 0000--0x8001 0000是能够读写的

请问是不是我板子在启动时有什么引脚注意拉高之类的原因还是ddr3的配置问题

代码如下:采用gel加载初始化时钟

void main()
{
    int i;
    Uint32 uiNum_cores;
    Uint32 uiDDR_B_Size, uiDDR_B_TotalSize;
    unsigned long long ullDDR_A_Size, ullDDR_A_TotalSize;
    volatile unsigned int far * uipInit_done;

    TSC_init();
    EDMA_init();

#if SINGLE_CORE_TEST
    uiNum_cores= 1;
#else
    uiNum_cores= NUMBER_DSP_CORES;
#endif

    /*allocate EDMA TCs between cores sequentially*/
    allocate_EDMA_TC(DNUM, uiNum_cores);

    uipInit_done= &uiInit_done;
    if((unsigned int)uipInit_done<0x1000000)
        /*convert local address of core 0 to global address*/
        uipInit_done= (volatile unsigned int *)((Uint32)uipInit_done+0x10000000);

    if(0==DNUM) //PLL and DDR initialization is done by core 0
    {
        //DSP core speed= MAIN_PLL_REF_CLK_MHZ*MAIN_PLL_MULTIPLIER/MAIN_PLL_DIVISOR
        //KeyStone_main_PLL_init(MAIN_PLL_REF_CLK_MHZ, MAIN_PLL_MULTIPLIER, MAIN_PLL_DIVISOR);
        //KeyStone_main_PLL_init(122.88, 39, 16);
        //KeyStone_main_PLL_init(156.25, 11, 3);
        //KeyStone_main_PLL_init(156.25, 23, 3);   //156.25*23/3=1197.91
        //DDR configuration
        //K2_DDR3A_config(NULL, NULL);
        //K2_DDR3B_config(NULL, NULL);

        //MEM_AddrTest(0x60000000,64*1024*1024,1);//能够达到512M
        MEM_AddrTest(0x800e0000,256*1024*1024,1);
        //KeyStone_memory_test(0x60000000, 0x60000000+1024*1024, 1, "DDR3B");
        //KeyStone_memory_test(0x80000000, 0x80000000+1024*1024, 1, "DDR3A");

        uiInit_done= 1;
        printf("ok");
        return;
    }

——————————————————————————————————————————————————————————

/*
this function write the address to corresponding memory unit and readback for verification
*/
unsigned int MEM_AddrTest(unsigned int uiStartAddress,
                        unsigned int uiCount,
                        int iStep)
{
    unsigned int i, uiFailCount=0;
    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 += (iStep);
    }

    ulpAddressPointer = (unsigned long long *)uiStartAddress;
    for(i=0; i<uiCount; i++)

    {
        ulReadBack = *ulpAddressPointer;
       PRINT("  Memory Test fails at 0x%8x\n", ulpAddressPointer);

        if ( ulReadBack != _itoll(((unsigned int)ulpAddressPointer)+4,
            (unsigned int)ulpAddressPointer)) /* verify data */
        {
            PRINT("  Memory Test fails at 0x%8x, Write 0x%16llx, Readback 0x%16llx\n", ulpAddressPointer, _itoll(((unsigned int)ulpAddressPointer)+4, (unsigned int)ulpAddressPointer), ulReadBack);
            uiFailCount++;
            if(uiFailCount>=MAX_ADDRESS_FAIL_COUNT)
                return uiFailCount;
        }
        ulpAddressPointer += (iStep);
    }
    return uiFailCount;              /* show no error */
}