Hi,
I am trying to configure a edma3 transfer with a transfer completion function.
I found an example for such code but I receive an error in the following line:
hIntc = CSL_intcOpen (&intcObj, CSL_INTC_EVENTID_EDMA3CC_GINT,&vectId , NULL);
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.
Hi,
I am trying to configure a edma3 transfer with a transfer completion function.
I found an example for such code but I receive an error in the following line:
hIntc = CSL_intcOpen (&intcObj, CSL_INTC_EVENTID_EDMA3CC_GINT,&vectId , NULL);
Ya,
This user guide has not been published yet, it should be soon. That said, the UG is not going to have descriptions of the events and the event numbers which are unique to the Keystone devices. This information is in the Data Manual you're using.
I'm going to ask someone from the SW support side to help out on this.
-Chad
Hi,
I am now using the MCSDK2.0 Beta for C6678 and I have met the same problem!
My question is, will MCSDK2.0 adds more examples about edma interrupts, just as C6747 does in MCSDK1.0? I am waiting for it eagarly!
Best regards!
Johnny
That is what worked for me (I took the code from the CSL examples, probably some lines are unnecessary)
CSL_Edma3Handle hModule;
CSL_Edma3Obj edmaObj;
CSL_Edma3ParamHandle hParam;
CSL_Edma3ChannelObj chObj;
CSL_Edma3CmdIntr regionIntr;
CSL_Edma3ChannelHandle hChannel;
CSL_Edma3ParamSetup myParamSetup;
CSL_Edma3Context context;
CSL_Edma3ChannelAttr chAttr;
CSL_Status status;
CSL_IntcObj intcObj;
CSL_IntcGlobalEnableState state;
CSL_IntcContext intcContext;
CSL_Status intStat;
CSL_IntcParam vectId;
CSL_IntcEventHandlerRecord EventRecord;
CSL_IntcHandle hIntc;
CSL_IntcEventHandlerRecord EventHandler[30];
EdmaTccHandler TccHandlerTable[64];
CSL_IntcRegsOvly CSL_IntcReg;
CSL_CPINTC_Handle hnd;
if (CSL_edma3Init(&context) != CSL_SOK)
{
printf ("Error: EDMA module initialization failed\n");
return -1;
}
/* Open the EDMA Module using the provided instance number */
hModule = CSL_edma3Open(&edmaObj, instNum, NULL, &status);
if ( (hModule == NULL) || (status != CSL_SOK))
{
printf ("Error: EDMA module open failed\n");
return -1;
}
/* Channel open */
chAttr.regionNum = CSL_EDMA3_REGION_GLOBAL;
chAttr.chaNum = channelNum;
hChannel = CSL_edma3ChannelOpen(&chObj, instNum, &chAttr, &status);
if ((hChannel == NULL) || (status != CSL_SOK))
{
printf ("Error: Unable to open EDMA Channel:%d\n", channelNum);
return -1;
}
/* Change Channel Default queue setup from 0 to 3 */
if (CSL_edma3HwChannelSetupQue(hChannel,CSL_EDMA3_QUE_3) != CSL_SOK)
{
printf ("Error: EDMA channel setup queue failed\n");
return -1;
}
/* Map the DMA Channel to PARAM Block 2. */
CSL_edma3MapDMAChannelToParamBlock (hModule, channelNum, 2);
/* Obtain a handle to parameter set 2 */
hParam = CSL_edma3GetParamHandle(hChannel, 2, &status);
if (hParam == NULL)
{
printf ("Error: EDMA Get Parameter Entry failed for 1.\n");
return -1;
}
/* Setup the parameter entry parameters (Ping buffer) */
myParamSetup.option = CSL_EDMA3_OPT_MAKE(CSL_EDMA3_ITCCH_DIS, \
CSL_EDMA3_TCCH_DIS, \
CSL_EDMA3_ITCINT_EN, \
CSL_EDMA3_TCINT_EN, \
TCC_NUM, CSL_EDMA3_TCC_NORMAL,\
CSL_EDMA3_FIFOWIDTH_NONE, \
CSL_EDMA3_STATIC_DIS, \
CSL_EDMA3_SYNC_A, \
CSL_EDMA3_ADDRMODE_INCR, \
CSL_EDMA3_ADDRMODE_INCR );
myParamSetup.srcAddr = (Uint32)srcBuff1;
myParamSetup.aCntbCnt = CSL_EDMA3_CNT_MAKE(N,1);
myParamSetup.dstAddr = (Uint32)dstBuff1;
myParamSetup.srcDstBidx = CSL_EDMA3_BIDX_MAKE(1,1);
myParamSetup.srcDstCidx = CSL_EDMA3_CIDX_MAKE(0,1);
myParamSetup.cCnt = 1;
/* Param setup */
if (CSL_edma3ParamSetup(hParam,&myParamSetup) != CSL_SOK)
{
printf ("Error: EDMA Parameter Entry Setup failed\n");
return -1;
}
regionIntr.region = CSL_EDMA3_REGION_GLOBAL;
regionIntr.intr = 0;
regionIntr.intrh = 0x0;
CSL_edma3HwControl(hModule,CSL_EDMA3_CMD_INTR_ENABLE,®ionIntr);
hnd = CSL_CPINTC_open(0);
if (hnd == 0)
{
printf ("Error: Unable to open CPINTC-0\n");
return -1;
}
/* Disable all host interrupts. */
CSL_CPINTC_disableAllHostInterrupt(hnd);
/* Configure no nesting support in the CPINTC Module. */
CSL_CPINTC_setNestingMode (hnd, CPINTC_NO_NESTING);
/* Map System Interrupt 36 (EDMACC GINT) to channel 3 */
CSL_CPINTC_mapSystemIntrToChannel (hnd, 36 , 3);
/* Enable system interrupt 36 */
CSL_CPINTC_enableSysInterrupt (hnd, 36);
/* We enable host interrupts. */
CSL_CPINTC_enableHostInterrupt (hnd, 3);
/* Enable all host interrupts also. */
CSL_CPINTC_enableAllHostInterrupt(hnd);
intcContext.eventhandlerRecord = EventHandler;
intcContext.numEvtEntries = 10;
/* Initiate INTC module */
if (CSL_intcInit(&intcContext) != CSL_SOK)
{
printf("Error: GEM-INTC initialization failed\n");
return -1;
}
/* Enable NMIs */
if (CSL_intcGlobalNmiEnable() != CSL_SOK)
{
printf("Error: GEM-INTC global NMI enable failed\n");
return -1;
}
/* Enable global interrupts */
if (CSL_intcGlobalEnable(&state) != CSL_SOK)
{
printf ("Error: GEM-INTC global enable failed\n");
return -1;
}
/* Open the INTC Module for Vector ID: 4 and Event ID: 63(INTC0_OUT3)*/
vectId = CSL_INTC_VECTID_4;
hIntc = CSL_intcOpen (&intcObj, 63, &vectId , NULL);
if (hIntc == NULL)
{
printf("Error: GEM-INTC Open failed\n");
return -1;
}
/* Register an call-back handler which is invoked when the event occurs. */
EventRecord.handler = &eventHandler;
EventRecord.arg = 0;
if (CSL_intcPlugEventHandler(hIntc,&EventRecord) != CSL_SOK)
{
printf("Error: GEM-INTC Plug event handler failed\n");
return -1;
}
/* Enabling the events. */
if (CSL_intcHwControl(hIntc,CSL_INTC_CMD_EVTENABLE, NULL) != CSL_SOK)
{
printf("Error: GEM-INTC CSL_INTC_CMD_EVTENABLE command failed\n");
return -1;
}
/* Trigger channel */
CSL_edma3HwChannelControl(hChannel,CSL_EDMA3_CMD_CHANNEL_SET,NULL);
Hi,
Please could you post the whole example that you talked about.
I didn't find it in CSL. The only example I found is located in:
\pdk_C6678_1_0_0_9_beta2\packages\ti\csl\example\edma\edma_test.c, and it doesn't work
also this example is very different from the code you post on may 5th
Thanks in advance.
Shmulik