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.

EDMA3 (LLD) data transferring when C count is larger than 1

 

The codes with DMA enabling are as follows:

For example, I use AB synchronization,  numenabled = ccnt; and then the function EDMA3_DRV_enableTransfer () will run ccnt times and so as the number of iterations for completion check.

 

My question is:

Is it possible to enable the DMA only once (without changing A count and B count) and wait for the completion only once, but perform the same data transferring (C count is larger than 1).
By the way, my environment is: C6474 EVM, DSP/BIOS, EDMA3 LLD.
/* * Since the transfer is going to happen in Manual mode of EDMA3

     * operation, we have to 'Enable the Transfer' multiple times.

     * Number of times depends upon the Mode (A/AB Sync)

     * and the different counts.  */

if (result == EDMA3_DRV_SOK)

{   /*Need to activate next param*/

    if (syncType == EDMA3_DRV_SYNC_A){

numenabled = bcnt * ccnt;

}

else{/* AB Sync Transfer Mode */

numenabled = ccnt;

}

for (i = 0; i < numenabled; i++)

{irqRaised1 = 0;

/** Now enable the transfer as many times as calculated above.*/

result = EDMA3_DRV_enableTransfer (hEdma, *chId, EDMA3_DRV_TRIG_MODE_MANUAL);

if (result != EDMA3_DRV_SOK)

{printf ("edma3_test: EDMA3_DRV_enableTransfer " \"Failed, error code: %d\r\n", result);

break;

}

// Wait for the Completion ISR. 

while (irqRaised1 == 0u){

// Wait for the Completion ISR on Master Channel.  

// You can insert your code here to do something meaningful.

}

// Check the status of the completed transfer 

if (irqRaised1 < 0){

// Some error occured, break from the FOR loop. 

/// printf ("\r\nedma3_test: Event Miss Occured!!!\r\n");

// Clear the error bits first 

result = EDMA3_DRV_clearErrorBits (hEdma, *chId);

break;

}

}

} // End of data transferring

 

 

 

 

 

 

  • In the Training section of TI.com, there is a training video set for the C6474. It may be helpful for you to review all of the modules. But in particular, the EDMA3/QDMA/IDMA Module will apply to your current questions. You can find the complete video set at http://focus.ti.com/docs/training/catalog/events/event.jhtml?sku=OLT110002 .

    In the EDMA3/QDMA/IDMA Module, there is a section on Linking vs. Chaining, and the last few slides in that section discuss Intermediate chaining and interrupts. This is what you will want to do to solve your problem.

    This may be more meaningful after reviewing the video, but your solution will be the following:

    1. Set OPT.TCC equal to your channel number
    2. Set OPT.ITCCHEN bit to enable intermediate chaining
    3. Make sure OPT.ITCCHEN=0 so you do not do an extra chain after the last transfer has completed
    4. Make sure OPT.ITCINTEN=0 so you do not get interrupts for each AB transfer
    5. Make sure OPT.TCINTEN=1, but you were already doing this, so it should be the same
    6. If you choose ASync, be sure to copy OPT.BCNT to OPT.BCNTRLD; this is not required for ABSync

    Now, when you do the enableTransfer MANUAL function call, the EDMA will start the first transfer manually, and then after each intermediate transfer completes that will cause another trigger automatically through chaining. You will not need to do anything in your code until the final transfer completes and the interrupt is generated after ACNT*BCNT*CCNT bytes have been transferred.