工程师好,我现在利用调用例子函数的EDMA搬移就能搬移成功,我把接口去掉直接调用内部函数搬移一直没更新,提示EDMA3_DRV_enableTransfer Failed, error code:-139错误代码。为了简洁我把srcBIdx这几个参数都先设置为64,我的程序如下:
EDMA3_DRV_PaRAMRegs paramSet;
EDMA3_DRV_Handle hEdma;
unsigned int chId0= 0;
unsigned int tcc0= 0;
unsigned int edmaInstance = 0;
EDMA3_DRV_Result edmaResult = EDMA3_DRV_SOK;
//EDMA3_DRV_Result result = EDMA3_DRV_SOK;,
hEdma = edma3init(edmaInstance, &edmaResult);
/* Setup for Channel 0*/
tcc0 = EDMA3_DRV_TCC_ANY;
chId0= EDMA3_DRV_DMA_CHANNEL_ANY;
/***************/
// Request any DMA channel and any TCC
EDMA3_DRV_requestChannel (hEdma, &chId0, &tcc0, (EDMA3_RM_EventQueue)0, NULL, NULL);
paramSet.srcBIdx = 64;
paramSet.destBIdx = 64;
paramSet.srcCIdx = 64;
paramSet.destCIdx = 64;
// For AB-synchronized transfers, BCNTRLD is not used.
paramSet.bCntReload = 64;
paramSet.linkAddr = 0xFFFFu;
// Src & Dest are in INCR modes
paramSet.opt &= 0xFFFFFFFCu;
// Program the TCC
paramSet.opt |= ((tcc0 << OPT_TCC_SHIFT) & OPT_TCC_MASK);
// Enable Intermediate & Final transfer completion interrupt
paramSet.opt |= (1 << OPT_ITCINTEN_SHIFT);
paramSet.opt |= (1 << OPT_TCINTEN_SHIFT);
paramSet.opt |= (1 << OPT_SYNCDIM_SHIFT);
/****************************************/
EDMA3_DRV_setPaRAM(hEdma, chId0, ¶mSet);
srcAddr = (Uint32)pMatC ;
dstAddr = (Uint32)pBufPackCL2 ;
pParamSet->srcAddr = srcAddr;
pParamSet->destAddr = dstAddr;
/* Now, write the PaRAM Set. */
EDMA3_DRV_setPaRAM(hEdma, chId, pParamSet);
EDMA3_DRV_setSrcParams (hEdma, chId, srcAddr, EDMA3_DRV_ADDR_MODE_INCR, EDMA3_DRV_W8BIT);
EDMA3_DRV_setDestParams(hEdma, chId, dstAddr, EDMA3_DRV_ADDR_MODE_INCR, EDMA3_DRV_W8BIT);
EDMA3_DRV_Result result = EDMA3_DRV_SOK;
// trigger DMA transfer
result = EDMA3_DRV_enableTransfer (hEdma, chId, EDMA3_DRV_TRIG_MODE_MANUAL);
if (result != EDMA3_DRV_SOK)
printf ("edma3_test: EDMA3_DRV_enableTransfer Failed, error code: %d\r\n", result);
Shine:
请问有没有用创建?
EDMA3_DRV_create (…);
hEdma = EDMA3_DRV_open (…);请参考下面wiki网站关于LLD的调用方法。
processors.wiki.ti.com/…/Programming_the_EDMA3_using_the_Low-Level_Driver_(LLD)
haotian chang:
回复 Shine:
我虽没有hEdma = EDMA3_DRV_open (…);但是用的hEdma = edma3init(edmaInstance, &edmaResult);创建的句柄
haotian chang:
回复 Shine:
工程师好,我利用edma3Init初始化判断,显示句柄没获得,想问一下,必须要用 EDMA3_DRV_open方式获取句柄吗?
haotian chang:
回复 Shine:
工程师好,我利用edma3Init初始,从DDR到SL2的搬移就能正确的搬移,一样的程序从DDR到核内L2的搬移,目的块的数据就一直没更新