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 fails transfer using 6678

Other Parts Discussed in Thread: TMS320C6678

Hi,

I am using tms320c6678 edma3 lld to implement transfer from one string to a bufferA that are going to store 8 strings and in addition when this buffer is full the transfer destination is going to point to bufferB.

All seems works fine but when I try that 1000 strings been transferred in the way described above around 2 or 3 strings  are corrupted, it seems like one character is not transferred and then after the hole transfer is about to end the character appears in another position.


This is the edma3 configuration:


        srcBuf = (char *) GLOBAL_ADDR((signed char*) pBuf);
        dstBuf = (char *) GLOBAL_ADDR((signed char*)bufA);


        /* Setup for DMA Channel 1*/
        tcc = EDMA3_DRV_TCC_ANY;
        chId = EDMA3_DRV_DMA_CHANNEL_ANY;

        /* Request any DMA channel and any TCC */
        if (result == EDMA3_DRV_SOK)
            {
            result = EDMA3_DRV_requestChannel (hEdma, &chId, &tcc,
                                                (EDMA3_RM_EventQueue)0,
                                                &callback1, NULL);
            }

        /*  Fill the PaRAM Sets associated with all these channels with transfer  specific information.  */
        if (result == EDMA3_DRV_SOK)
        {
            paramSet.srcBIdx    = (int16_t)200;
            paramSet.destBIdx   = (int16_t)200;
            paramSet.srcCIdx    = (int16_t)200;
            paramSet.destCIdx   = (int16_t)200;

            paramSet.aCnt       = (uint16_t)200;
            paramSet.bCnt       = (uint16_t)1;
            paramSet.cCnt       = (uint16_t)1;

            /* For AB-synchronized transfers, BCNTRLD is not used. */
            paramSet.bCntReload = (uint16_t)1;
            /* Src & Dest are in INCR modes */
            paramSet.opt &= 0xFFFFFFFCu;
            /* Program the TCC */
            paramSet.opt |= ((tcc << OPT_TCC_SHIFT) & OPT_TCC_MASK);

            /* Enable Intermediate & Final transfer completion interrupt */
            paramSet.opt |= (1 << OPT_ITCINTEN_SHIFT);
            paramSet.opt |= (1 << OPT_TCINTEN_SHIFT);

            /* AB Sync Transfer Mode */
            paramSet.opt |= (1 << OPT_SYNCDIM_SHIFT);



            /* Program the source and dest addresses for master DMA channel */
            paramSet.srcAddr    = (unsigned int) srcBuf;
            paramSet.destAddr   = (unsigned int) dstBuf;


            /* Write to the master DMA channel first. */
            result = EDMA3_DRV_setPaRAM(hEdma, chId, &paramSet);
        }

        /* If write is successful, write almost the same thing. */
        if (result == EDMA3_DRV_SOK)
        {
            result = EDMA3_DRV_setPaRAM(hEdma, lChId1, &paramSet);
        }

The transfer is triggered from the callback function of a Daemon.

This is the way I am triggering the transfer:

        if (edmaRes == EDMA3_DRV_SOK)
        {
            edmaRes = EDMA3_DRV_getPaRAMPhyAddr(hEdma, chId, &phyaddress);
        }

        param_handle = (EDMA3_DRV_ParamentryRegs *)phyaddress;
        param_handle->SRC = (unsigned int) GLOBAL_ADDR((signed char*)pBuf);
        if(count_str == 0) {
            if( flg_bufA == TRUE )
                param_handle->DST =(unsigned int )(char*)GLOBAL_ADDR((signed char*)( bufA ));
            else if( flg_bufB == TRUE )
                param_handle->DST =(unsigned int )(char*)GLOBAL_ADDR((signed char*)( bufB ));
        }
        edmaRes = send2buf( hEdma, chId );
        param_handle->DST += 200u;


How can I find out what is going wrong with the transfers? or maybe  Am I not considering something in configuration? I hope someone can help me.


Thanks in advance.


Julian