I am using EVMOMAPL137 and trying to use EDMA3 with ACPY3 API
I am able to copy data from one location to another(from external memory(SDRAM) to internal(L2)).
But when I want to use ACPY3_wait() function in order to wait the transfer be completed, I fail.
I am trying to read just after the ACPY3_wait() function, and I see that copy process is not completed yet.
How can I be sure that data was really copied??
int c,e,*copied=(int*)0x11801FF9, *expected=(int*)0xc0001FF9;
ACPY3_Params tcfg;
IDMA3_ChannelRec dmaTab;
IDMA3_Handle dmaHandle;
int status;
*copied=0;
DMAN3_init();
ACPY3_init();
/* Set up the DMA Channel descriptor with the transfer parameters */
dmaTab.numTransfers = 1;
dmaTab.numWaits = 1;
dmaTab.priority = IDMA3_PRIORITY_LOW;
/* The ACPY3 transfer protocol will be used as the IDMA3 protocol object
* This object defines the memory requirements and the initialization and
* de-initialization functions for the protocol's environment */
dmaTab.protocol = &ACPY3_PROTOCOL;
dmaTab.persistent = FALSE;
/*
* On success this call will return a valid DMA channel handle with the
* attributes defined above
*/
status = DMAN3_createChannels(0, &dmaTab, 1);
if (status == DMAN3_SOK) printf("DMAN3 is ok\n");
dmaHandle = dmaTab.handle;
ACPY3_activate(dmaHandle);
tcfg.transferType = ACPY3_1D1D;
tcfg.srcAddr = (void *) 0xc0000000;
tcfg.dstAddr = (void *) 0x11800000;
tcfg.elementSize = 8192 * sizeof (int);
tcfg.numElements = 1;
tcfg.numFrames = 1;
tcfg.waitId = 1;
ACPY3_configure (dmaHandle, &tcfg, tcfg0);
ACPY3_start (dmaHandle);
ACPY3_wait (dmaHandle);
c=*copied; // one of the last locations to campare
e=*expected;
if(c == e) printf("success to copy by the end\n");
else printf("fail to copy by the end\n");