完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
我运行ti自带的edma3数据搬移的例子, 搬移2个数组(src1,src2)到2个数组(dst1,dst2)可以成功,但当我再加一个数组,想尝试搬移三个数组(src1,2,3)到dst1,dst2,dst3,就失败了, 该怎么做
|
|
相关推荐
9个回答
|
|
您的描述不太清楚,麻烦说明使用的是哪个用例?操作方式相关信息。
|
|
|
|
就是TI自带的edma_test.c 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_A, CSL_EDMA3_ADDRMODE_INCR, CSL_EDMA3_ADDRMODE_INCR ); myParamSetup.srcAddr = (Uint32)srcBuff1; myParamSetup.aCntbCnt = CSL_EDMA3_CNT_MAKE(256,1); myParamSetup.dstAddr = (Uint32)dstBuff1; myParamSetup.srcDstBidx = CSL_EDMA3_BIDX_MAKE(1,1); myParamSetup.linkBcntrld= CSL_EDMA3_LINKBCNTRLD_MAKE(hParamPong,0); myParamSetup.srcDstCidx = CSL_EDMA3_CIDX_MAKE(0,1); myParamSetup.cCnt = 1; /* Ping setup */ if (CSL_edma3ParamSetup(hParamPing,&myParamSetup) != CSL_SOK) [ printf ("Error: EDMA Parameter Entry Setup failedn"); return -1; ]; /* Pong setup */ myParamSetup.linkBcntrld = CSL_EDMA3_LINKBCNTRLD_MAKE(hParamPing,0); myParamSetup.option = CSL_EDMA3_OPT_MAKE(CSL_EDMA3_ITCCH_DIS, CSL_EDMA3_TCCH_DIS, CSL_EDMA3_ITCINT_DIS, CSL_EDMA3_TCINT_EN, 1, CSL_EDMA3_TCC_NORMAL, CSL_EDMA3_FIFOWIDTH_NONE, CSL_EDMA3_STATIC_EN, CSL_EDMA3_SYNC_A, CSL_EDMA3_ADDRMODE_INCR, CSL_EDMA3_ADDRMODE_INCR ); myParamSetup.srcAddr = (Uint32)srcBuff2; myParamSetup.dstAddr = (Uint32)dstBuff2; if (CSL_edma3ParamSetup(hParamPong,&myParamSetup) != CSL_SOK) [ printf ("Error: EDMA Parameter Entry Setup failedn"); return -1; ]; /*******************************/ 我加了一组类似的链接, myParamSetup.linkBcntrld = CSL_EDMA3_LINKBCNTRLD_MAKE(hParamOut,0); myParamSetup.option = CSL_EDMA3_OPT_MAKE(CSL_EDMA3_ITCCH_DIS, CSL_EDMA3_TCCH_DIS, CSL_EDMA3_ITCINT_DIS, CSL_EDMA3_TCINT_EN, 1, CSL_EDMA3_TCC_NORMAL, CSL_EDMA3_FIFOWIDTH_NONE, CSL_EDMA3_STATIC_EN, CSL_EDMA3_SYNC_A, CSL_EDMA3_ADDRMODE_INCR, CSL_EDMA3_ADDRMODE_INCR ); myParamSetup.srcAddr = (Uint32)srcBuff3; myParamSetup.dstAddr = (Uint32)dstBuff3; if (CSL_edma3ParamSetup(hParamPong,&myParamSetup) != CSL_SOK) [ printf ("Error: EDMA Parameter Entry Setup failedn"); return -1; ] ; 其他的没改,前两组数据可以搬进去, 我自己加的一组就搬不过去了,是不下面的程序要改哪些参数? /* Interrupt enable (Bits 0-1) for the global region interrupts */ regionIntr.region = CSL_EDMA3_REGION_GLOBAL; regionIntr.intr = 0x3; regionIntr.intrh = 0x0000; CSL_edma3HwControl(hModule,CSL_EDMA3_CMD_INTR_ENABLE,®ionIntr); /* 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); /* Trigger Channel */ CSL_edma3HwChannelControl(hChannel,CSL_EDMA3_CMD_CHANNEL_SET,NULL); /* Poll on IPR bit 2 */ do [ CSL_edma3GetHwStatus(hModule,CSL_EDMA3_QUERY_INTRPEND,®ionIntr); ] while (!(regionIntr.intr & 0x2)); /* Check transfer by comparing the source and destination buffers */ if(Verify_Transfer( 256, 1, 1, 0, 0, 0, 0, srcBuff1, dstBuff1, TRUE) == FALSE) [ printf ("Error: Verification (Source1/Destination1) Failedn"); return -1; ] if(Verify_Transfer( 256, 1, 1, 0, 0, 0, 0, srcBuff2, dstBuff2, TRUE) == FALSE) [ printf ("Error: Verification (Source2/Destination2) Failedn"); return -1; ] /* Close channel */ if (CSL_edma3ChannelClose(hChannel) != CSL_SOK) [ printf("Error: EDMA Channel Close failedn"); return -1; ] /* Close EDMA module */ if (CSL_edma3Close(hModule) != CSL_SOK) [ printf("Error: EDMA Module Close failedn"); return -1; ]; 直接copy过来看着有点乱 麻烦了 |
|
|
|
sagffag 发表于 2018-6-21 06:54 hParamOut 是我自己定义的 hParamOut = CSL_edma3GetParamHandle(hChannel,3,&status); |
|
|
|
sagffag 发表于 2018-6-21 06:54 EDMA有3个要素: 1. 触发方式,event 触发/手动触发/event chain式触发 2. PaRAM配置 3. 触发使能和提交 1.看你的代码你应该用的是手动触发,你要确认你新增的触发源是否和以前的有冲突; 2. 新增触发源对应的PaRAM选择是否正确 3. PaRAM的配置中,参数是否正确,例如使用全局地址 4. 判断传输完成的event 设置是否正确,例如TCC的配置是否有冲突 |
|
|
|
我新增的触发源和参数配置都是没问题的,TCC是否有冲突是怎么看的?后面这三个函数调用机制我不太懂,搬移2组他调用2次,我搬移三组是否就调用三次? regionIntr.region = CSL_EDMA3_REGION_GLOBAL; regionIntr.intr = 0x7; regionIntr.intrh = 0x0000; CSL_edma3HwControl(hModule,CSL_EDMA3_CMD_INTR_ENABLE,®ionIntr); /* Trigger channel */ CSL_edma3HwChannelControl(hChannel,CSL_EDMA3_CMD_CHANNEL_SET,NULL); CSL_edma3GetHwStatus(hModule,CSL_EDMA3_QUERY_INTRPEND,®ionIntr); |
|
|
|
sagffag 发表于 2018-6-21 07:33 1.红色的部分就是用来配TCC number的,你用的是1和第二个配置相同 myParamSetup.option = CSL_EDMA3_OPT_MAKE(CSL_EDMA3_ITCCH_DIS, CSL_EDMA3_TCCH_DIS, CSL_EDMA3_ITCINT_DIS, CSL_EDMA3_TCINT_EN, 1, CSL_EDMA3_TCC_NORMAL, CSL_EDMA3_FIFOWIDTH_NONE, CSL_EDMA3_STATIC_EN, CSL_EDMA3_SYNC_A, CSL_EDMA3_ADDRMODE_INCR, CSL_EDMA3_ADDRMODE_INCR ); 2. regionIntr.region = CSL_EDMA3_REGION_GLOBAL; regionIntr.intr = 0x7; regionIntr.intrh = 0x0000; CSL_edma3HwControl(hModule,CSL_EDMA3_CMD_INTR_ENABLE,®ionIntr); 用来选择使用哪个shadow region和对应region中断event的使能,EDMA总共有8个Shadow region和1个global region /* Trigger channel */ CSL_edma3HwChannelControl(hChannel,CSL_EDMA3_CMD_CHANNEL_SET,NULL); 用来手动触发EDMA 传输 CSL_edma3GetHwStatus(hModule,CSL_EDMA3_QUERY_INTRPEND,®ionIntr); 用来等待传输是否完成,对应的TPCC_IPR 中断标志是否被置位 |
|
|
|
dechun28448 发表于 2018-6-21 07:49 谢谢你 将的很清楚 不过我改了TCC还是跑不了 另外我不知道我的regionintr配置是否正确 麻烦你帮我看下。 int EdmaTrans () [ CSL_Edma3Handle hModule; CSL_Edma3Obj edmaObj; CSL_Edma3ParamHandle hParamPing; CSL_Edma3ParamHandle hParamPong; CSL_Edma3ParamHandle hParamOut; CSL_Edma3ChannelObj chObj; CSL_Edma3CmdIntr regionIntr; CSL_Edma3ChannelHandle hChannel; CSL_Edma3ParamSetup myParamSetup; CSL_Edma3Context context; CSL_Edma3ChannelAttr chAttr; CSL_Status status; int instNum; unsigned char channelNum; instNum = 1; channelNum = 1; /* Module initialization */ if (CSL_edma3Init(&context) != CSL_SOK) [ printf ("Error: EDMA module initialization failedn"); return -1; ] /* Open the EDMA Module using the provided instance number */ hModule = CSL_edma3Open(&edmaObj, instNum, NULL, &status); if ( (hModule == NULL) || (status != CSL_SOK)) [ printf ("Error: EDMA module open failedn"); return -1; ] /* Channel open */ chAttr.regionNum = CSL_EDMA3_REGION_GLOBAL; chAttr.chaNum = channelNum; hChannel = CSL_edma3ChannelOpen(&chObj, instNum, &chAttr, &status); if ((hChannel == NULL) || (status != CSL_SOK)) [ printf ("Error: Unable to open EDMA Channel:%dn", channelNum); return -1; ] 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) [ printf ("Error: EDMA channel setup queue failedn"); return -1; ] ] 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) [ printf ("Error: EDMA channel setup queue failedn"); return -1; ] ] CSL_edma3MapDMAChannelToParamBlock (hModule, channelNum, 2); hParamPing = CSL_edma3GetParamHandle(hChannel, 2, &status); /* Obtain a handle to parameter set 1 */ hParamPong = CSL_edma3GetParamHandle(hChannel, 1, &status); hParamOut = CSL_edma3GetParamHandle(hChannel,3,&status); /* Setup the parameter entry parameters (Ping buffer) */ 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_A, CSL_EDMA3_ADDRMODE_INCR, CSL_EDMA3_ADDRMODE_INCR ); myParamSetup.srcAddr = (Uint32)srcBuff1; myParamSetup.aCntbCnt = CSL_EDMA3_CNT_MAKE(15,1); myParamSetup.dstAddr = (Uint32) dstBuff1; myParamSetup.srcDstBidx = CSL_EDMA3_BIDX_MAKE(0,0); myParamSetup.linkBcntrld= CSL_EDMA3_LINKBCNTRLD_MAKE(hParamPong,0); myParamSetup.srcDstCidx = CSL_EDMA3_CIDX_MAKE(0,0); myParamSetup.cCnt = 1; /* Ping setup */ if (CSL_edma3ParamSetup(hParamPing,&myParamSetup) != CSL_SOK) [ printf ("Error: EDMA Parameter Entry Setup failedn"); return -1; ] /* Pong setup */ myParamSetup.option = CSL_EDMA3_OPT_MAKE(CSL_EDMA3_ITCCH_DIS, CSL_EDMA3_TCCH_DIS, CSL_EDMA3_ITCINT_DIS, CSL_EDMA3_TCINT_EN, 1, CSL_EDMA3_TCC_NORMAL, CSL_EDMA3_FIFOWIDTH_NONE, CSL_EDMA3_STATIC_DIS, CSL_EDMA3_SYNC_A, CSL_EDMA3_ADDRMODE_INCR, CSL_EDMA3_ADDRMODE_INCR ); myParamSetup.srcAddr = (Uint32)srcBuff2; myParamSetup.aCntbCnt = CSL_EDMA3_CNT_MAKE(15,1); myParamSetup.dstAddr = (Uint32)dstBuff2; myParamSetup.srcDstBidx = CSL_EDMA3_BIDX_MAKE(1,0); myParamSetup.linkBcntrld = CSL_EDMA3_LINKBCNTRLD_MAKE(hParamPing,0); myParamSetup.srcDstCidx = CSL_EDMA3_CIDX_MAKE(0,0); myParamSetup.cCnt = 1; if (CSL_edma3ParamSetup(hParamPong,&myParamSetup) != CSL_SOK) [ printf ("Error: EDMA Parameter Entry Setup failedn"); return -1; ] myParamSetup.option = CSL_EDMA3_OPT_MAKE(CSL_EDMA3_ITCCH_DIS, CSL_EDMA3_TCCH_DIS, CSL_EDMA3_ITCINT_DIS, CSL_EDMA3_TCINT_EN, 2, CSL_EDMA3_TCC_NORMAL, CSL_EDMA3_FIFOWIDTH_NONE, CSL_EDMA3_STATIC_DIS, CSL_EDMA3_SYNC_A, CSL_EDMA3_ADDRMODE_INCR, CSL_EDMA3_ADDRMODE_INCR ); myParamSetup.srcAddr = (Uint32)srcBuff3; myParamSetup.dstAddr = (Uint32) dstBuff3; myParamSetup.linkBcntrld = CSL_EDMA3_LINKBCNTRLD_MAKE(hParamOut,0); CSL_edma3ParamSetup(hParamOut,&myParamSetup); regionIntr.region = CSL_EDMA3_REGION_GLOBAL; regionIntr.intr = 0x7; regionIntr.intrh = 0x0000; CSL_edma3HwControl(hModule,CSL_EDMA3_CMD_INTR_ENABLE,®ionIntr); CSL_edma3HwChannelControl(hChannel,CSL_EDMA3_CMD_CHANNEL_SET,NULL); CSL_edma3GetHwStatus(hModule,CSL_EDMA3_QUERY_INTRPEND,®ionIntr); /* Interrupt enable (Bits 0-1) for the global region interrupts */ regionIntr.region = CSL_EDMA3_REGION_GLOBAL; regionIntr.intr = 0x3; regionIntr.intrh = 0x0000; CSL_edma3HwControl(hModule,CSL_EDMA3_CMD_INTR_ENABLE,®ionIntr); /* Trigger channel */ CSL_edma3HwChannelControl(hChannel,CSL_EDMA3_CMD_CHANNEL_SET,NULL); regionIntr.region = CSL_EDMA3_REGION_GLOBAL; regionIntr.intr = 0; regionIntr.intrh = 0; CSL_edma3GetHwStatus(hModule,CSL_EDMA3_QUERY_INTRPEND,®ionIntr); /* Clear the pending bit */ CSL_edma3HwControl(hModule,CSL_EDMA3_CMD_INTRPEND_CLEAR,®ionIntr); /* Trigger Channel */ CSL_edma3HwChannelControl(hChannel,CSL_EDMA3_CMD_CHANNEL_SET,NULL); /* Poll on IPR bit 2 */ CSL_edma3GetHwStatus(hModule,CSL_EDMA3_QUERY_INTRPEND,®ionIntr); if (CSL_edma3ChannelClose(hChannel) != CSL_SOK) [ printf("Error: EDMA Channel Close failedn"); return -1; ] if (CSL_edma3Close(hModule) != CSL_SOK) [ printf("Error: EDMA Module Close failedn"); return -1; ] return 0; ] |
|
|
|
dechun28448 发表于 2018-6-21 07:49 其实我做的是TCP3E一个传输的任务,只要简单的完成TCP3E传输功能 ,不使用BIOS 他的EDMA3需要传输 配置信息和输入数据进入TCP3E,然后传输turbo encoder后的结果出来 ,所以我感觉edma3 需要三次传输。 |
|
|
|
sagffag 发表于 2018-6-21 08:02 建议不要直接增加代码,你先理解清楚样例中的实现是如何对EDMA进行操作的,之后再按照你的需求进行修改。 |
|
|
|
只有小组成员才能发言,加入小组>>
332 浏览 1 评论
528 浏览 2 评论
NA555DR VCC最低电压需要在5V供电,为什么用3.3V供电搭了个单稳态触发器也使用正常?
772 浏览 3 评论
MSP430F249TPMR出现高温存储后失效了的情况,怎么解决?
649 浏览 1 评论
对于多级放大电路板,在PCB布局中,电源摆放的位置应该注意什么?
1124 浏览 1 评论
AT32F407在USART2 DMA发送数据时,接包接到了要发送的数据,程序还是处于等待传输完成的标识判断中,为什么?
54浏览 29评论
88浏览 23评论
请问下tpa3220实际测试引脚功能和官方资料不符,哪位大佬可以帮忙解答下
248浏览 20评论
请教下关于TAS5825PEVM评估模块原理图中不太明白的地方,寻求答疑
196浏览 14评论
两个TMP117传感器一个可以正常读取温度值,一个读取的值一直是0,为什么?
54浏览 13评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-21 18:02 , Processed in 0.913385 second(s), Total 61, Slave 54 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号