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.

upp使用中遇到一个无法理解的问题



C6748、StarterWare环境,使用upp Channel A单通道进行数据发送时(发送的数据是0、1无限循环;数据存储在DDR2),通过示波器查看,最低位管脚UPP_CH1_D0的电平,正常;
在使能 L1、L2 缓存后,upp Channel A的window发送完成中断仍然可以正常进入,但是示波器检测到的UPP_CH1_D0管脚的电平,一直是低电平。
 

备注:
①使能L1、L2缓存,用的是:
        除此之外,没有做其他任何修改。

②使能 L1、L2 缓存后,如果upp的内部DMA所发送的数据在256KB L2 共享内置 RAM( o = 0x11800000  l = 0x00040000),那么检测到的UPP_CH1_D0的电平,也是正常的。
 
代码,在附件中。
uPP_A_Send.zip
  • 发现一个小问题,DDR长度不对,不知道会不会有影响。我最近使用CACHE也遇到问题,我只使能L1CACHE,发现使能的CACHE大小居然会影响程序的运行,不知你有没有遇到这种情况。

  • 是因为开了Cache后,CPU对buffer的操作结果存在Cache里,没有更新到DDR,需要在写buffer后加一个Cache write back操作。

    int main(void)
    {
     //CacheEnableMAR((unsigned int)0xC0000000, (unsigned int)0x20000000);
     //CacheEnable(L1DCFG_L1DMODE_32K | L1PCFG_L1PMODE_32K | L2CFG_L2MODE_256K);

     int i;

     // ϵͳ³õʼ»¯
     sys_init();

     // ³õʼ»¯Òª·¢Ë͵ÄÊý¾Ý
     UARTPuts("\tInitialize data buffers...\r\n", -2);
     // Initialize data buffers
     //upp_buffer[0] = 0x68;
     for (i = 0; i < UPP_FRAME_SIZE; i++)
     {
        upp_buffer[i] = i % 2;
     }
     //upp_buffer[UPP_FRAME_SIZE - 1] = 0x0;

     upp_reg_hdl->UPID0 = (Uint32)upp_buffer;
     upp_reg_hdl->UPID1 = ((Uint32)UPP_LINE_COUNT << 16) | (Uint32)UPP_FRAME_SIZE * sizeof(Int8);
     upp_reg_hdl->UPID2 = (Uint32)UPP_LINE_OFFSET * sizeof(Int8);
     while(1);
    }