/* Module initialization */
if (CSL_edma3Init(&context) != CSL_SOK)
{
System_printf ("Error: EDMA module initialization failed\n");
}
/* Open the EDMA Module using the provided instance number */
hModule = CSL_edma3Open(&edmaObj, instNum, NULL, &status);
if ( (hModule == NULL) || (status != CSL_SOK))
{
System_printf ("Error: EDMA module open failed\n");
}
/* Channel open */
chAttr.regionNum = CSL_EDMA3_REGION_GLOBAL;
chAttr.chaNum = channelNum;
hChannel = CSL_edma3ChannelOpen(&chObj, instNum, &chAttr, &status);
if ((hChannel == NULL) || (status != CSL_SOK))
{
System_printf ("Error: Unable to open EDMA Channel:%d\n", channelNum);
}
if(!instNum)
{
/* For first EDMA instance there are only 2 TCs and 2 event queues
* Modify the channel default queue setup from 0 to 1
*/
if (CSL_edma3HwChannelSetupQue(hChannel,CSL_EDMA3_QUE_1) != CSL_SOK)
{
System_printf ("Error: EDMA channel setup queue failed\n");
}
}
else
{
/* For EDMA instance 1 and 2 maximum of 4 TCs and 4 event queues are supported
* Change Channel Default queue setup from 0 to 3
*/
if (CSL_edma3HwChannelSetupQue(hChannel,CSL_EDMA3_QUE_3) != CSL_SOK)
{
System_printf ("Error: EDMA channel setup queue failed\n");
}
}
/* Map the DMA Channel to PARAM Block 2. */
CSL_edma3MapDMAChannelToParamBlock (hModule, channelNum, 2);
/* Obtain a handle to parameter set 2 */
hParam = CSL_edma3GetParamHandle(hChannel, 2, &status);
if (hParam == NULL)
{
System_printf ("Error: EDMA Get Parameter Entry failed for 2.\n");
}
/* Setup the parameter entry parameters */
myParamSetup.option = CSL_EDMA3_OPT_MAKE(CSL_EDMA3_ITCCH_DIS, \
CSL_EDMA3_TCCH_DIS, \
CSL_EDMA3_ITCINT_DIS, \
CSL_EDMA3_TCINT_EN, \
0, CSL_EDMA3_TCC_NORMAL,\
CSL_EDMA3_FIFOWIDTH_NONE, \
CSL_EDMA3_STATIC_DIS, \
CSL_EDMA3_SYNC_AB, \
CSL_EDMA3_ADDRMODE_INCR, \
CSL_EDMA3_ADDRMODE_INCR );
myParamSetup.srcAddr = (Uint32)srcBuff;
myParamSetup.aCntbCnt = CSL_EDMA3_CNT_MAKE(EDMA3_ACNT,EDMA3_BCNT);
myParamSetup.dstAddr = (Uint32)dstBuff2;
myParamSetup.srcDstBidx = CSL_EDMA3_BIDX_MAKE(EDMA3_ACNT,EDMA3_ACNT);
myParamSetup.linkBcntrld= CSL_EDMA3_LINKBCNTRLD_MAKE(0xffff,0);
myParamSetup.srcDstCidx = CSL_EDMA3_CIDX_MAKE(0,0);
myParamSetup.cCnt = 1;
/* Ping setup */
if (CSL_edma3ParamSetup(hParam,&myParamSetup) != CSL_SOK)
{
System_printf ("Error: EDMA Parameter Entry Setup failed\n");
}
/* Interrupt enable (Bits 0-1) for the global region interrupts */
regionIntr.region = CSL_EDMA3_REGION_GLOBAL;
regionIntr.intr = 0x1;
regionIntr.intrh = 0x0000;
CSL_edma3HwControl(hModule,CSL_EDMA3_CMD_INTR_ENABLE,®ionIntr);
start_timel=TSCL;
start_timeh=TSCH;
/* Trigger channel */
CSL_edma3HwChannelControl(hChannel,CSL_EDMA3_CMD_CHANNEL_SET,NULL);
regionIntr.region = CSL_EDMA3_REGION_GLOBAL;
regionIntr.intr = 0;
regionIntr.intrh = 0;
/* Poll on IPR bit 0 */
do {
CSL_edma3GetHwStatus(hModule,CSL_EDMA3_QUERY_INTRPEND,®ionIntr);
} while (!(regionIntr.intr & 0x1));
/* Clear the pending bit */
CSL_edma3HwControl(hModule,CSL_EDMA3_CMD_INTRPEND_CLEAR,®ionIntr);
这是我调试EDMA3的配置代码,在我允许CSL_edma3HwChannelControl(hChannel,CSL_EDMA3_CMD_CHANNEL_SET,NULL);语句开始EDMA3传送数据时,发生错误:
C66xx_0: Power Failure on Target CPUC66xx_0: Failed to remove the debug state from the target before disconnecting. There may still be breakpoint op-codes embedded in program memory. It is recommended that you reset the emulator before you connect and reload your program before you continue debugging。
这是什么原因啊,是我EDMA3配置代码有问题吗?我用的CCS5.4,MCSDK也更新了的。
wei he1:
可能我的条件没有给清楚。出错的程序中EDMA3_ACNT=1024*10,EDMA3_BCNT=1024*20,也就是我要传200MBytes的数据。此时srcBuff我放在了DDR3_1里面,DDR3_1 (RWX) : org = 0x80000000, len = 0x20000000。dstBuff是hyperlink数据空间的起始地址0X40000000。
后面我又试着将要传输的数据改小,EDMA3_ACNT=1024*10,EDMA3_BCNT=1024*2,也就是我要传20MBytes的数据,修改后的程序就能正常运行了,而且传递的数据也是对的。而后我又改成EDMA3_ACNT=1024*10,EDMA3_BCNT=1024*5,也就是50MBytes的数据,结果出了和上面一样的错!
我想问下,在EDMA3的AB模式下,数据传输量最大不是可以为65536*65536,即ANCT_MAX*BCNT_MAX吗,为什么会出现这样的现象??
wei he1:
回复 wei he1:
另外下面是我的工程.map文件中的内存占用状态:
MEMORY CONFIGURATION
name origin length used unused attr fill———————- ——– ——— ——– ——– —- ——– L2SRAM 00800000 00080000 00003800 0007c800 RW X MSMCSRAM 0c000000 00400000 00004000 003fc000 RW X DDR3_1 80000000 20000000 014242e6 1ebdbd1a RW X DDR3_2 a0000000 10000000 00000000 10000000 RW X
Andy Yin1:
回复 wei he1:
我觉得可能是由于目的地址在Hyperlink data section导致,你可以试试将目的地址改成存放在DDR3_1,如果测试通过的话,可能是hyperlink没有往外传输数据堵塞之类的原因导致。
jian zong1:
回复 wei he1:
你好,可以问一下,你的邮箱吗?? 我有个openMP的问题,想向你请教,就是在6678的openmMP,模板工程,没有任何改动,可以编译,但是加载到核时,报错,请问这什么问题呢??谢谢