TI中文支持网
TI专业的中文技术问题搜集分享网站

C6748的EDMA问题

现在我们使用C6748芯片遇到了一个EDMA的奇怪问题。麻烦贵公司的技术工程师帮我们看一下,这个问题怎么解决.

// 使用  GPIO  BANK5  PIN2 作为外部事件触发EDMA

使用EDMA的channel 29传输,Each event triggers the transfer of a single array of ACNT bytes,ACNT=2;    Linked Transfer     link参数PARAM127  和PARAM126

寄存器配置如下:

/* EDMA register address and definitions */

#define EDMA_CC_BASE   (0x01C00000) /* 6748. Check address for other devices. */

#define CCCFG  *((volatile unsigned int *)(EDMA_CC_BASE + 0x0004))

#define QCHMAP0     *((volatile unsigned int *)(EDMA_CC_BASE + 0x0200))

#define DMAQNUM0    *((volatile unsigned int *)(EDMA_CC_BASE + 0x0240))

#define DMAQNUM3    *((volatile unsigned int *)(EDMA_CC_BASE + 0x024C))

#define QUEPRI      *((volatile unsigned int *)(EDMA_CC_BASE + 0x0284))

#define EMR         *((volatile unsigned int *)(EDMA_CC_BASE + 0x0300))

#define EMCR        *((volatile unsigned int *)(EDMA_CC_BASE + 0x0308))

#define QEMCR       *((volatile unsigned int *)(EDMA_CC_BASE + 0x0314))

#define CCERR       *((volatile unsigned int *)(EDMA_CC_BASE + 0x0318))

#define CCERRCLR    *((volatile unsigned int *)(EDMA_CC_BASE + 0x031C))

#define QWMTHRA     *((volatile unsigned int *)(EDMA_CC_BASE + 0x0620))

#define ECR         *((volatile unsigned int *)(EDMA_CC_BASE + 0x1008))

#define ESR         *((volatile unsigned int *)(EDMA_CC_BASE + 0x1010))

#define EER         *((volatile unsigned int *)(EDMA_CC_BASE + 0x1020))

#define EECR        *((volatile unsigned int *)(EDMA_CC_BASE + 0x1028))

#define EESR        *((volatile unsigned int *)(EDMA_CC_BASE + 0x1030))

#define SECR  *((volatile unsigned int *)(EDMA_CC_BASE + 0x1040))

#define IER         *((volatile unsigned int *)(EDMA_CC_BASE + 0x1050))

#define IECR        *((volatile unsigned int *)(EDMA_CC_BASE + 0x1058))

#define IESR        *((volatile unsigned int *)(EDMA_CC_BASE + 0x1060))

#define IPR         *((volatile unsigned int *)(EDMA_CC_BASE + 0x1068))

#define ICR         *((volatile unsigned int *)(EDMA_CC_BASE + 0x1070))

#define DRAE0        *((volatile unsigned int *)(EDMA_CC_BASE + 0x340))

#define ECR0         *((volatile unsigned int *)(EDMA_CC_BASE + 0x2008))

#define ESR0         *((volatile unsigned int *)(EDMA_CC_BASE + 0x2010))

#define EER0         *((volatile unsigned int *)(EDMA_CC_BASE + 0x2020))

#define EECR0        *((volatile unsigned int *)(EDMA_CC_BASE + 0x2028))

#define EESR0        *((volatile unsigned int *)(EDMA_CC_BASE + 0x2030))

#define SECR0  *((volatile unsigned int *)(EDMA_CC_BASE + 0x2040))

#define IPR0          *((volatile unsigned int *)(EDMA_CC_BASE + 0x2068))

#define ICR0         *((volatile unsigned int *)(EDMA_CC_BASE + 0x2070))

#define PARAMENTRY0     (0x01C04000) /* 6748. Check address for other devices. */

#define OPT0             *((volatile unsigned int *)(PARAMENTRY0 + 0x00))

#define SRC0             *((volatile unsigned int *)(PARAMENTRY0 + 0x04))

#define A_B_CNT0         *((volatile unsigned int *)(PARAMENTRY0 + 0x08))

#define DST0             *((volatile unsigned int *)(PARAMENTRY0 + 0x0C))

#define SRC_DST_BIDX0    *((volatile unsigned int *)(PARAMENTRY0 + 0x10))

#define LINK_BCNTRLD0    *((volatile unsigned int *)(PARAMENTRY0 + 0x14))

#define SRC_DST_CIDX0    *((volatile unsigned int *)(PARAMENTRY0 + 0x18))

#define CCNT0            *((volatile unsigned int *)(PARAMENTRY0 + 0x1C))

#define PARAMENTRY29     (0x01C043A0) /* 6748. Check address for other devices. */

#define OPT             *((volatile unsigned int *)(PARAMENTRY29 + 0x00))

#define SRC             *((volatile unsigned int *)(PARAMENTRY29 + 0x04))

#define A_B_CNT         *((volatile unsigned int *)(PARAMENTRY29 + 0x08))

#define DST             *((volatile unsigned int *)(PARAMENTRY29 + 0x0C))

#define SRC_DST_BIDX    *((volatile unsigned int *)(PARAMENTRY29 + 0x10))

#define LINK_BCNTRLD    *((volatile unsigned int *)(PARAMENTRY29 + 0x14))

#define SRC_DST_CIDX    *((volatile unsigned int *)(PARAMENTRY29 + 0x18))

#define CCNT            *((volatile unsigned int *)(PARAMENTRY29 + 0x1C))

#define PARAMENTRY127     (0x01C04FE0) /* 6748. Check address for other devices. */

#define OPT1             *((volatile unsigned int *)(PARAMENTRY127 + 0x00))

#define SRC1             *((volatile unsigned int *)(PARAMENTRY127 + 0x04))

#define A_B_CNT1         *((volatile unsigned int *)(PARAMENTRY127 + 0x08))

#define DST1             *((volatile unsigned int *)(PARAMENTRY127 + 0x0C))

#define SRC_DST_BIDX1    *((volatile unsigned int *)(PARAMENTRY127 + 0x10))

#define LINK_BCNTRLD1    *((volatile unsigned int *)(PARAMENTRY127 + 0x14))

#define SRC_DST_CIDX1    *((volatile unsigned int *)(PARAMENTRY127 + 0x18))

#define CCNT1            *((volatile unsigned int *)(PARAMENTRY127 + 0x1C))

#define PARAMENTRY126     (0x01C04FC0) /* 6748. Check address for other devices. */

#define OPT2             *((volatile unsigned int *)(PARAMENTRY126 + 0x00))

#define SRC2             *((volatile unsigned int *)(PARAMENTRY126 + 0x04))

#define A_B_CNT2         *((volatile unsigned int *)(PARAMENTRY126 + 0x08))

#define DST2             *((volatile unsigned int *)(PARAMENTRY126 + 0x0C))

#define SRC_DST_BIDX2    *((volatile unsigned int *)(PARAMENTRY126 + 0x10))

#define LINK_BCNTRLD2    *((volatile unsigned int *)(PARAMENTRY126 + 0x14))

#define SRC_DST_CIDX2    *((volatile unsigned int *)(PARAMENTRY126 + 0x18))

#define CCNT2            *((volatile unsigned int *)(PARAMENTRY126 + 0x1C))

#define   BINTEN   *((volatile unsigned int *)(0x01E26008))

#define   SET_RIS_TRIG45 *((volatile unsigned int *)(0x01E26074))

#define   CLR_RIS_TRIG45 *((volatile unsigned int *)(0x01E26078))

#define   INTSTAT45   *((volatile unsigned int *)(0x01E26084))

void configure_EDMA(short *outBuffer1,short *outBuffer2)

{

QUEPRI=0x10;

QWMTHRA =(16<<8u)|(16 & 0xFF);

EMCR =  0xFFFFFFFF;

CCERRCLR = 0xFFFFFFFF;

DRAE0=0xFFFFFFFF;

DMAQNUM3=0x0;

DMAQNUM3=0x0;

EESR0=0x20000000;

OPT = 0x00100000;  

SRC = (unsigned int)&outBuffer1;

A_B_CNT = ((100<< 16u) | (2&0xFFFFu));    

DST =(unsigned int)&outBuffer2;

SRC_DST_BIDX = (2<< 16u) | (2& 0xFFFFu);    

LINK_BCNTRLD = (0 << 16u) | 0x4FE0u;    

SRC_DST_CIDX = 0;

CCNT = 1;

OPT1 = 0x00100000;  

SRC1 = (unsigned int)&outBuffer1;

A_B_CNT1 = ((100 << 16u) | (2&0xFFFFu));    

DST1 =(unsigned int)&outBuffer2[100];

SRC_DST_BIDX1 = (2<< 16u) | (2& 0xFFFFu);    

LINK_BCNTRLD1 = (0 << 16u) | 0x4FC0u;    

SRC_DST_CIDX1 = 0;

CCNT1 = 1;

OPT2 = 0x00100000;  

SRC2 = (unsigned int)&outBuffer1;

A_B_CNT2 = ((100 << 16u) | (2&0xFFFFu));    

DST2 =(unsigned int)&outBuffer2[200];

SRC_DST_BIDX2 = (2<< 16u) | (2& 0xFFFFu);    

LINK_BCNTRLD2 = (0 << 16u) | 0x4FE0u;    

SRC_DST_CIDX2 = 0;

CCNT2 = 1;

SET_RIS_TRIG45=0x10000;

BINTEN=0x20;    //使能GPIO中断事件

}

 for(i=0;i<100;i++)

 outBuffer1[i]=200+i;

得到outBuffer2的结果如下:

0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0

3688 4481 3688 4481 100 0 3688 4481 3688 4481

3688 4481 3688 4481 3688 4481 3688 4481 3688 4481

3688 4481 200 201 202 203 204 205 206 207

208 209 210 211 212 213 214 215 216 217

218 219 220 221 222 223 224 225 226 227

228 229 230 231 232 233 234 235 236 237

238 239 240 241 242 243 244 245 246 247

248 249 250 251 252 253 254 255 256 257

258 259 260 261 262 263 264 265 266 267

268 269 270 271 272 273 274 275 276 277

3688 4481 3688 4481 100 0 3688 4481 3688 4481

3688 4481 3688 4481 3688 4481 3688 4481 3688 4481

3688 4481 200 201 202 203 204 205 206 207

208 209 210 211 212 213 214 215 216 217

218 219 220 221 222 223 224 225 226 227

228 229 230 231 232 233 234 235 236 237

238 239 240 241 242 243 244 245 246 247

248 249 250 251 252 253 254 255 256 257

258 259 260 261 262 263 264 265 266 267

268 269 270 271 272 273 274 275 276 277

为什么结果中多了3688 4481 3688 4481 100 0 3688 4481 3688 4481

3688 4481 3688 4481 3688 4481 3688 4481 3688 4481

3688 4481这22个数据(我没有传输者这些数据呀,这些数据是从哪儿来的哦),而少传输了278~299这22个数据呢?

谢谢工程师的回答。

Tony Tang:

从OPT的配置并没有使能Chain,只使能了传输完成中断。我很好奇这配置如何能有上面三组传输数据?先把配置更正测试一下吧。

EricSun:

回复 zhaoshuai li:

没看出来啊

赞(0)
未经允许不得转载:TI中文支持网 » C6748的EDMA问题
分享到: 更多 (0)