各位大神:
如题。有利用sys/Bios完成的吗?
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.
建个hello world,然后直接往DDR3里读写即可,DDR3地址从0x80000000开始
Allen Yin:
您好,感谢您的回答!其实是这样的,我想用EDMA将网口接收到的数据直接读入到DDR3中,再用cpu读取这些数据,需要设置什么吗?
你需要配置网口,网口用的是CPPI+PacketDMA,你可以先到首页上把K1_STK开发包下载下来学习一下怎么用网口,或者使用MCSDK里面的PDK开发包的网口的驱动
我仿照MCSDK中的cilent例程,通过tcp协议传输,connect成功后通过recv函数能接收到数据。但是我不知道该怎样不经过cpu直接存储到DDR3中。我参考首页例程中的memory_test例程,发现里面设置了很多东西,然后自己复制了一些,但是从cpu中读写数据也出问题了,我的代码如下:
int i;
KeyStone_main_PLL_init(100, 10, 1);
/*XMC memory address extension/mapping and memory protection.
*remap Shared L2 to 0x18000000 for noncacheable and nonprefetchable access*/
KeyStone_XMC_MPAX_setup(XMC_MPAX_cfg_table, 0,
sizeof(XMC_MPAX_cfg_table)/sizeof(MPAX_Config));
TSC_init();
EDMA_init();
/*enable L1P ED and scrub whole L1P*/
L1P_EDC_setup();
/*enable LL2 EDC and scrub whole LL2*/
LL2_EDC_setup();
/*Enable MSMC EDC and setup scrubbing cycle counter= 255*1024*/
KeyStone_SL2_EDC_enable(255);
uiLL2EndAddress= 0x00900000;
uiSL2EndAddress= 0x0C100000;
uiRemappedSL2EndAddress= REMAPPED_SL2_TEST_START_ARRD+0x100000;
uiDDREndAddress= 0xA0000000;
uiLL2StartAddress= get_unused_L2_address();
//make remapped SL2 noncacheable, nonprefetchable
gpCGEM_regs->MAR[(REMAPPED_SL2_TEST_START_ARRD/16/1024/1024)]=0;
/*make DDR cacheable and prefetchable*/
for(i= 0; i< (uiDDREndAddress-DDR_TEST_START_ARRD)/16/1024/1024; i++)
gpCGEM_regs->MAR[(DDR_TEST_START_ARRD/16/1024/1024)+i]=1|
(1<<CSL_CGEM_MAR0_PFX_SHIFT);
number_of_cores = 2;
//make other cores L2 cacheable and prefetchable
for(i=0; i< number_of_cores; i++)
{
gpCGEM_regs->MAR[0x10800000/16/1024/1024+i]=1|
(1<<CSL_CGEM_MAR0_PFX_SHIFT);
}
CACHE_setL1PSize(CACHE_L1_32KCACHE);
CACHE_setL1DSize(CACHE_L1_32KCACHE);
CACHE_setL2Size(CACHE_0KCACHE);
int pBuf[10] = {1,2,3,4,5,6,7,8,9,0};
char out[10];
int j;
for(j=0;j<13;j++)
out[j] = 0;
IDMA_copy((unsigned int)pBuf,DDR_TEST_START_ARRD, 13, DMA_WAIT);
printf("end edma write\n");
IDMA_copy(DDR_TEST_START_ARRD,(unsigned int)out, 13, DMA_WAIT);
printf("end edma read\n");
for(j=0;j<13;j++)
printf("out = %d\n",out[j]);
这里先忽略了网络传输,所有的函数都是复制的memory_test中的函数,但是最后输出来的还是out的初始值,不是pBuf里的值,请问是哪里设置错了吗?