int test_idma_chan0 (void)
{
Uint32 i, mask;
Uint32 idmaChan0TestFailed = 0;
CSL_IDMA_IDMA0CONFIG idmaChan0Config;
Uint32 bWaitEnable = 1;
memcpy(src2, src, sizeof(unsigned int) * 32);
/* Configure IDMA Channel 0 Transfer */
mask = MASK;
idmaChan0Config.mask = mask;
idmaChan0Config.source = src2;
idmaChan0Config.destn = dst2;
idmaChan0Config.count = 0; /* transfer one 32-byte window */
idmaChan0Config.intEnable = 1; /* Enable CP U interrupt on completion. */
CSL_IDMA_chan0TransferData (&idmaChan0Config, bWaitEnable);
printf("Src Address: 0x%X dst: 0x%X \n", src2, dst2);
for (i = 0; i < 32; i++) {
/* Check as per the mask we configured if the * data was transferred to CFG MMR space.
*/
if(!(mask & 0x1)) {
if (src2[i] != dst2[i]) {
printf("IDMA Channel 0: configuring the MMRs FAILED.\n");
idmaChan0TestFailed++;
return idmaChan0TestFailed;
}
else {
printf("IDMA Channel 0: src[%d] is: 0x%X dst2[%d] is: 0x%X\n", \
i,src2[i],i,dst2[i]);
}
} else {
printf("\tIDMA Channel 0: Performing transfer of this data src[%d]: \
0x%X is blocked off by the mask.\n",i,src2[i]); }
mask = mask >> 1;
}
return idmaChan0TestFailed;
}
这是我idma的通道0的初始化操作,就是把src2的数据转移到dst2,但是不管怎样,首个字节总是不对,如图:
我先用memcpy把src的数据搬移到src2,然后在用idma通道0搬移到dst2,其中dst2的内存数据如图:
其中src的第一个数据是0x0BADBEEF,而dst2的第一个数据是0x80ADBEEF,这是什么原因啊 大家帮忙看看 谢谢!
下面附上整个程序
Allen35065:
0x02704000是寄存器的reserve空间,为什么要往这里写?