I'm following the fastcopytest example for a nonAlgorithm DMA implementation and I cannot get DMAN3 to give me DMA channels.
I have DMAN3 configured in the .cfg file:
/* DMAN3 stuff */
var DMAN3 = xdc.useModule('ti.sdo.fc.dman3.DMAN3');
/* Note new configuration in DMAN3 */
DMAN3.useExternalRM = false;
DMAN3.heapInternal = "L1DHEAP";
DMAN3.heapExternal = "EXTERNALHEAP";
DMAN3.numQdmaChannels = 8;
DMAN3.paRamBaseIndex = 78;
DMAN3.numPaRamEntries = 48;
DMAN3.nullPaRamIndex = 127;
DMAN3.tccAllocationMaskH = 0xffffffff;
DMAN3.tccAllocationMaskL = 0x0;
DMAN3.numTccGroup = [4, 3, 2, 0, 0, 5];
DMAN3.numPaRamGroup = [4, 4, 2, 0, 0, 5];
DMAN3.qdmaChannels = [0, 1, 2, 3, 4, 5, 6, 7];
DMAN3.maxQdmaChannels = 8;
DMAN3.maxTCs = 2;
/* ACPY3 stuff */
var ACPY3 = xdc.useModule('ti.sdo.fc.acpy3.ACPY3');
DMAN3 and ACPY3 are initialized in the DSP's main:
void init_DMA()
{
/*
* Initialize DMA manager and ACPY3 library for XDAIS algorithms
* and grant DMA resources
*/
DMAN3_init();
ACPY3_init();
//FCPY_init(); <-- do I need this?
}
The function to activate DMA channels:
int activateChannels(IDMA3_Handle h[])
{
IDMA3_ChannelRec dmaTab[2];
Int status, k;
/* setup the DMA channel descriptor */
for (k=0;k<2;k++){
dmaTab[k].handle = NULL;
dmaTab[k].numTransfers = 1;
dmaTab[k].numWaits = 1;
dmaTab[k].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[k].protocol = &ACPY3_PROTOCOL;
dmaTab[k].persistent = FALSE;
}
/*
* On success this call will return a valid DMA channel handle with the
* attributes defined above
*/
status = DMAN3_createChannels(0, dmaTab, 2);
if (status == DMAN3_SOK ) {
h[0] = dmaTab[0].handle;
h[1] = dmaTab[1].handle;
/* Put the channel in active state */
/* Now other ACPY3 APIs can be called on this handle */
ACPY3_activate(h[0]);
ACPY3_activate(h[1]);
}
else {
System_printf("Channel create failed. Status: %d\n", status);
return(-1);
}
return(0);
}
DMAN3_createChannels is returning -2. What am I missing?
Lee Holeva