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!