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 interrupt just occur one time

I use edma3_lld_02_11_09_08 to develop my edma3 driver,but the ISR function just enter one time,my configure are as follows:

#define  PING_PONG_ACNT          1
#define  PING_PONG_BCNT          8*32*40   //应该小于65535
#define  PING_PONG_CCNT          1
#define  MCASP_BASEADDR          0x01D00000
#define  Mcasp_RXEVENTQUE        (0u)

/* OPT Field specific defines */
#define OPT_SYNCDIM_SHIFT                   (0x00000002u)
#define OPT_TCC_MASK                        (0x0003F000u)
#define OPT_TCC_SHIFT                       (0x0000000Cu)
#define OPT_ITCINTEN_SHIFT                  (0x00000015u)
#define OPT_TCINTEN_SHIFT                   (0x00000014u)

static void my_edma3_init()
{
    EDMA3_DRV_PaRAMRegs paramSet = {0,0,0,0,0,0,0,0,0,0,0,0};
    EDMA3_DRV_Result result = EDMA3_DRV_SOK;
    EDMA3_DRV_Handle hEdma;
    uint32_t chId   = 0;
    uint32_t tcc    = 0;
    
    print2arm("edma3 driver init...",0);

    hEdma = edma3init(0,&result);
    if(hEdma)
    {
        print2arm("edma3init() Passed.",0);
    }
    else
    {
        print2arm("edma3init() Failed.",0);
    }
    
    if (result == EDMA3_DRV_SOK)
    {
        result = EDMA3_DRV_requestChannel (hEdma, &chId, &tcc,
                                       (EDMA3_RM_EventQueue)0,
                                            &edma3_isr, NULL);
    }
    
    if(result == EDMA3_DRV_SOK)
    {
        paramSet.srcBIdx    = 0;
        paramSet.destBIdx   = 1;
        paramSet.srcCIdx    = 0;
        paramSet.destCIdx   = 0;
        paramSet.aCnt       = PING_PONG_ACNT;
        paramSet.bCnt       = PING_PONG_BCNT;
        paramSet.cCnt       = PING_PONG_CCNT;
        
        /* For AB-synchronized transfers, BCNTRLD is not used. */
        paramSet.bCntReload = PING_PONG_BCNT;

        /* Src in constant mode Dest in INCR modes */
        paramSet.opt &= 0xFFFFFFFDu;
        //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    = (uint32_t)(MCASP_BASEADDR+0X029C);
        paramSet.destAddr   = (uint32_t)(ping_buffer);

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

    result = EDMA3_DRV_enableTransfer(hEdma,chId,EDMA3_DRV_TRIG_MODE_EVENT);
    
    if(result == EDMA3_DRV_SOK)
    {
        print2arm("edma3 driver init success.",0);
    }
}

The edma3_isr function is called just one time!!!!!    WHY??????


I use mcasp AREVT event to trigger edma3 transfer.

  • Hi,

    Thanks for your post.

    I think, your comprehension sounds good but there is a sample test case available for EDMA based ping pong based data copy using DMA and a link channel. Please find the attached source file for the DMA test case.

    May be, you could find the sample app. project from the below path after installing edma3_lld_02_11_09_08 package which would hold you an appropriate base code reference to walkthrough and it would help you to develop your own application to match your requirement:

    ~\ti\edma3_lld_02_11_09_08\examples\edma3_driver\evmOMAPL138\sample_app

    /cfs-file/__key/communityserver-discussions-components-files/791/8686.dma_5F00_ping_5F00_pong_5F00_test.c

    If you want to build EDMA3 examples then please refer to the following docs in EDMA3 installed location:

    ~\ti\edma3_lld_02_11_09_08\packages\ti\sdo\edma3\drv\docs\EDMA3_Driver_User_Guide.pdf

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    -------------------------------------------------------------------------------------------------------

  • I refer to the edma3_lld_02_11_09_08/examples/edma3_driver/src/dma_ping_pong_test.c , BUT my problem is why it just generate one time interrupt ????? Can you help me?
  • Jianming Liao,

    It is very difficult to follow your code since it is not written in a familiar way following our example. It is much easier for you to use our example to make your application work. There are only a few changes you will need to make, and then you will have a working example.

    From that, you can then compare all of the EDMA3 registers and DSP interrupt registers to figure out what you have done wrong.

    You should not have either OPT.SAM or OPT.DAM set to 1 for constant addressing mode. You would not do this if you had started from our example.

    What is the value of the Reload field? It is relevant to your problem, and the behavior of the EDMA3 after the first interrupt occurs.

    Our examples are meant to show you the right way to work with these features. We have had to carefully debug those examples for your benefit, and we have a difficult time remotely debugging fresh code that does not come from the experience of our applications team.

    Regards,
    RandyP