This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

What am I doing wrong?

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

 

  • What version of Framework Components are you using ? And what device are you trying to build for ? Have you been able to successfully run DMAN3 examples for your device ?

    The error code you are seeing is an "unspecified error". It is usually related to:-

    DMAN3_init not having occured correctly or incorrect configuration.

    Depending on the version of FC you are using, you could also switch on trace to get some information about the failure mechanism:-

    http://processors.wiki.ti.com/index.php/Trace_in_Framework_Components

     

    Gunjan.

  • Gunjan said:
    What version of Framework Components are you using ? And what device are you trying to build for ? Have you been able to successfully run DMAN3 examples for your device ?

    Framework 3_21_00_17_eng for the C6a816x EVM.  There are no Framework examples specifically for the C6a8168 and I'm guessing for the configuration.   I'll try enabling the trace to see what that indicates.

    Lee Holeva

     

     

  • Are you sure DMA is enabled for your device ? I remember running into an issue because my gel file hadn't enabled the DMA.

    Also, in general we do NOT intend to support the DMAN3/ACPY3 libraries on these new devices. We have a new interface called the IRES EDMA3CHAN and the ECPY library, which will be recommended for use for these devices.

    Please look at some examples on how to use those and use those instead.

    For now, I'm attaching a DMAN3 .cfg file, that I had cooked up for the TI816X platform, maybe this will have what you need. Switching on trace, should give you more information.

    7607.fastcopytest.cfg.txt

  • Gunjan said:
    Are you sure DMA is enabled for your device ?

    I assumed that DMA had been enabled on the DSP, as you can't do efficient processing without it.  The Ti81xx-PSP-EDMA-Driver User Guide says that QDMA channels 0-3 and 5-7 are available for the DSP, and QDMA channel 4 is for the ARM.

    Gunjan said:
    Also, in general we do NOT intend to support the DMAN3/ACPY3 libraries on these new devices. We have a new interface called the IRES EDMA3CHAN and the ECPY library, which will be recommended for use for these devices.

    Where do I get this?  EZSDK 5.01 for the EVM that I'm using came with Framework.

    Lee Holeva

     

  • As long as you know that the DMA is enabled, you should be good. 

    Regarding the QDMA channel assignments, DMAN3 can work with 1 to max QDMA channels. Use the following configurations to control what channels DMAN3 uses.

        DMAN3.numQdmaChannels = 4;
        DMAN3.qdmaChannels = [0, 1, 2, 3];
    The above configuration makes sure that only the first 4 QDMA channels are used by DMAN3. You can make the above additions to your .cfg file, and try and request resources, and maybe enable trace to see why DMAN3 is failing.
    
    
    
    
    
    
    The new interfaces and library are all part of the framework components release.
    See ti.sdo.fc.ires.edma3chan for the interface, and ti.sdo.fc.ecpy for the DMA library.
    Since you are familiar with DMAN3 and ACPY3, a simpler way to put it is:-
    IRES EDMA3CHAN is equivalent to IDMA3 interface i.e, algorithms implement the IRES EDMA3CHAN interface to request  DMA resources
    RMAN is equivalent to DMAN3 i.e., RMAN is the generic resource manager, which, among other things, also manages DMA resource requirements of algorithms.
    ECPY is equivalent to ACPY3 i.e, ECPY is the functional EDMA-channel based DMA library that algorithms can then use with resources acquired using the IRES EDMA3CHAN interface.
    
    
    To see an example of a codec implementing the IRES EDMA3CHAN interface and then using ECPY to do transfers see:-
    ti.sdo.fc.ires.examples.codecs.universal_dma
    To see an example of an application that instantiates the above codec and grants it resources (Via RMAN), see:-
    ti.sdo.fc.rman.examples.dmaXferScratch.

  • Lee,


    I would try setting linux driver to use  QDMA Channel number 7
    You can then remove 7 from this setting in cfg file and set numQdmaChannels to 7
    DMAN3.qdmaChannels = [0, 1, 2, 3,4,5,6];
    DMAN3.numQdmaChannels = 7;
    and see if this helps too. This will help DSP get all the QDMA channels except 7, with a maximum of 7 QDMA channels


    RV

    
    

     

  • This configuration appears to work with the C6a8168:

    var DMAN3 = xdc.useModule('ti.sdo.fc.dman3.DMAN3');
    var ACPY3 = xdc.useModule('ti.sdo.fc.acpy3.ACPY3');

    /* Note new configuration in DMAN3 */
    DMAN3.useExternalRM = false;
    //DMAN3.useExternalRM = true;

    DMAN3.heapInternal = "L1DHEAP";
    DMAN3.heapExternal = "EXTERNALHEAP";

    if (DMAN3.useExternalRM == true) {
        var EDMA3 = xdc.useModule("ti.sdo.fc.edma3.Settings");
        EDMA3.semCreateFxn = "mySemCreate";
        EDMA3.semDeleteFxn = "mySemDelete";
        EDMA3.semPendFxn = "mySemPend";
        EDMA3.semPostFxn = "mySemPost";
        EDMA3.persistentAllocFxn = "_ALG_allocMemory";
        EDMA3.persistentFreeFxn = "_ALG_freeMemory";

        var EDMA3LLD = xdc.loadPackage('ti.sdo.edma3.rm');
        EDMA3LLD.profile = "debug";
        EDMA3.maxPaRams = [4,3,2,0,0,5];
        EDMA3.maxTccs = [4,3,2,0,0,5];
        DMAN3.numQdmaChannels = 1;
    }
    else {
        DMAN3.qdmaPaRamBase = 0x09004000;
        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, 5, 6, 7];
        DMAN3.maxQdmaChannels = 7;
        DMAN3.maxTCs          = 4;
    }

    xdc.loadPackage("ti.sdo.fc.global").profile = "debug";

    Per the TI81xx-PSP-EDMA-Driver-User-Guide, I removed qdma channel 4.

    Lee Holeva

     

  • Awesome.  Thanks for testing and posting your results.

    You saved me a whole lot of headache.

     

    RV