First, I have the polled 2D transfer working without problem using information from the document EDMA3_Driver_User_Guide.pdf (I believe this is also called the LLD but not sure). The basic operation uses the polling method by calling the function EDMA3_DRV_waitAndClearTcc. All data is correct and my effort is to eliminate the polling by implementing the callback function. It is somewhat confusing to me because they use the term interrupt but then it is implemented with a callback. So am I understanding at least this much correctly? I really expected to use an HWI for this but it doesn't seen necessary.
If I debug this with CCS I get 2 results: 1) it will execute the callback function but then when it exits this function I don't really know where it goes but I think all processing has stopped, or 2) sometimes when it breaks inside the ISR I will try to step it and CCS 3.3 immediately closes. Never does it execute the callback more than once. I have tried adding EDMA3_DRV_checkAndClearTcc inside the callback but no noticeable change.
Here is some setup code, g_Cntr is a global int just to pass something:
result = EDMA3_DRV_requestChannel (hEdma, pchan_ID, ptcc_code, (EDMA3_RM_EventQueue)0, (EDMA3_RM_TccCallback)&callback, &g_Cntr);
result = EDMA3_DRV_setOptField (hEdma, *pchan_ID, EDMA3_DRV_OPT_FIELD_TCINTEN, 1u);
result = EDMA3_DRV_setOptField (hEdma, *pchan_ID, EDMA3_DRV_OPT_FIELD_SAM, EDMA3_DRV_ADDR_MODE_INCR);
result = EDMA3_DRV_setOptField (hEdma, *pchan_ID, EDMA3_DRV_OPT_FIELD_DAM, EDMA3_DRV_ADDR_MODE_INCR);
result = EDMA3_DRV_setOptField (hEdma, *pchan_ID, EDMA3_DRV_OPT_FIELD_STATIC, 1u);
This is the callback function - I don't think the EDMA3_DRV_checkAndClearTcc needs to be there but I've tried it both ways same result:
void callback (unsigned int tcc, EDMA3_RM_TccStatus status, void *appData)
{
EDMA3_DRV_Result result = EDMA3_DRV_SOK;
int *cbData = (int *)appData;
unsigned short status2;
switch (status)
{
case EDMA3_RM_XFER_COMPLETE:
*cbData = tcc;
result = EDMA3_DRV_checkAndClearTcc(hEdma, tcc, &status2);
break;
case EDMA3_RM_E_CC_DMA_EVT_MISS:
// evtMiss++;
break;
case EDMA3_RM_E_CC_QDMA_EVT_MISS:
break;
default:
break;
}
}
Any suggestions please? Thank you, Ed