Part Number: TMS320C6713B
Hi
I am doing maintenance on some old code running on TMS320C6713, and I have some EDMA probles. I want to copy every second value from source to dest.
int source[5][65536];
int dest[5][32768];
To do this one need to use “1D” transfer since the element index is stepped by a value different from 1, and since the arrays are big one need to divide them into frames, and this is where I run into troubles.
I want to start the DMA transfer, and then I check the CIPR bit at each timer interrupt to see when the transfer is finished.
I have made a test case with smaller arrays:
int mySource[4][16];
int myDest[4][8];
EDMA_Handle handle;
EDMA_Config config;
short tcc;
EDMA_Handle hMyReload;
EDMA_Config myConfig = {
EDMA_OPT_RMK(
EDMA_OPT_PRI_LOW,
EDMA_OPT_ESIZE_32BIT,
EDMA_OPT_2DS_NO,
EDMA_OPT_SUM_IDX,
EDMA_OPT_2DD_NO,
EDMA_OPT_DUM_INC,
EDMA_OPT_TCINT_YES,
EDMA_OPT_TCC_OF(0), //Reserve TCC later
EDMA_OPT_LINK_YES,
EDMA_OPT_FS_YES
),
EDMA_SRC_OF(&mySource[0]),
EDMA_CNT_OF(0x00030008), // 0x0003=4 frames, 0x0008=Elements to copy in one frame
EDMA_DST_OF(&myDest[0]),
EDMA_IDX_OF(0x00400008), // 0x0040 bytes offset to next frame, 0x0008=Element index (in bytes)
EDMA_RLD_OF(0)}
//---
//EDMA setup
config = myConfig;
handle = EDMA_open(EDMA_CHA_ANY, EDMA_OPEN_RESET); //Open any free local_id
EDMA_config(handle, &config);
tcc = EDMA_intAlloc(-1); ////Reserve a TCC number (0 to 15), -1=any free CIPR/TCC
config.opt |= EDMA_FMK(OPT, TCC, tcc); //Update options
EDMA_intDisable(tcc); //We want to access irq registers like CIRP, but not generate a CPU interrupt since we will poll.
EDMA_config(handle, &config); //Update config
hMyReload = EDMA_allocTable(-1); //Allocate reload
EDMA_config(hMyReload, &config); //Config reload
EDMA_link(handle , hMyReload); //Link the handlers together
EDMA_link(hMyReload , hMyReload);
//--
The problenm I have with this code is that I have to run
EDMA_setChannel(handle)
four times (i.e. same as the frame size) before the entire copy process i done and the CIPR bit is set.
How can I kick the EDMA transfer to run all frames in one go?
BR
AD