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.

AM5728 Register EDMA3 interrupt

Other Parts Discussed in Thread: AM5728

I am trying to use EMDA3 on the AM5728, TI-RTOS, DSP Core.

The EDMA is doing it's job correctly, but the callback function is never getting called.  The following code registers the callback function callback1 with the EDMA3 Driver.

result = EDMA3_DRV_requestChannel(edmaHandle,
                                      chId,
                                      tcc,
                                      (EDMA3_RM_EventQueue)0,
                                      (EDMA3_RM_TccCallback)callback1,
                                      NULL); 

The opt is setup like this

        // OPT bits setup see TRM Table 16-332
        paramSet->opt &= 0xFFFFFFFCU; // Src & Dest INCR mode bits 0/1 set to 0
        paramSet->opt &= 0xFFFFFFFBu; // SYNCDIM A-sync mode sends ACNT bytes

        /* 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);

The following code setups up the transfer, starts the transfer and waits for completion.

 EDMA3_DRV_Result result = EDMA3_DRV_setPaRAM(edmaHandle, chId, paramSet);
 if (result != EDMA3_DRV_SOK)
 {
  PCIE_logPrintf  ("edma3_test: EDMA3_DRV_setPaRAM " \
       "Failed, error code: %d\n", result);
 }
 else
 {
  result = EDMA3_DRV_enableTransfer (edmaHandle, chId,
           EDMA3_DRV_TRIG_MODE_MANUAL);
  if (result != EDMA3_DRV_SOK)
  {
   PCIE_logPrintf  ("edma3_test: EDMA3_DRV_enableTransfer " \
        "Failed, error code: %d\n", result);
  }
  else
  {
      PCIE_logPrintf ("Wait for complete\n");
      while(1);
   EDMA3_DRV_waitAndClearTcc(edmaHandle, tcc);
   PCIE_logPrintf ("Transfer 1 completed!\n");
  }
 }

I added the while(1) to make sure the waitAndClearTcc was not clearing something before I was able to get the interrupt. callback1 is never called.

Searching the forums and in the document EDMA3_Driver_User_guide.doc I see the following comment.

"During the initialization sequence, EDMA3 Driver, being an OS independent module,
doesn’t register various interrupt handlers with the underlying OS. The application
which is using the EDMA3 Driver should register the various Interrupt Handlers (ISRs in Resource Manager) with the underlying OS on which it is running. "

The examples in the pdk_am57xx package do not seem to do this and on the forums the discussion is for other hardware.

Can a code example be provided (or pointed to) which can do what is needed here?

Thanks!

  • I will ask the RTOS team to look at this.
  • Done a bit more digging to try to understand this...

    My application calls edma3init() which is provided in the file sample_init.c, which calls registerEdma3Interrupts from the file
    edma3_lld_02_12_01_22\packages\ti\sdo\edma3\drv\sample\src\platforms\sample_tda2xx_int_reg.c. Before this register function the comment says:

    /** To Register the ISRs with the underlying OS, if required. */

    So, I am thinking this is exactly what I need, but perhaps the wrong version. I have no idea how the library picks the platform to use and in this case I don't see any files for the AM5728.
  • Success! Dig, Dig, Dig. Since the example I started with did not use interrupts the following lines were missing from the .cfg.

    ECM.eventGroupHwiNum[0] = 7;
    ECM.eventGroupHwiNum[1] = 8;
    ECM.eventGroupHwiNum[2] = 9;
    ECM.eventGroupHwiNum[3] = 10;

    Seems like these are the defaults. Can anyone explain why these are setup this way or what they mean?