Tool/software:
Setup:
- Board: EVM6678
- SDK: Processor SDK 6.03.00.106
- Example: Nimu_emacExample (includes NDK library and Daemon function)
- Added module: H.265 encoder example (h265venc_ti_c66x)
Both the NIMU/NDK example and the H.265 encoder are running correctly.
static Int32 qdma_link_xfer_region (Int32 instNum, Uint8 channelNum, Int32 regionNum , Int32 myParam, Uint8 tcc)
{
CSL_Edma3Handle hModule;
CSL_Edma3Obj edmaObj;
CSL_Edma3ParamHandle hParamPong,hParamPing;
CSL_Edma3ChannelObj chObj;
CSL_Edma3CmdIntr regionIntr;
CSL_Edma3CmdDrae regionAccess;
CSL_Edma3ChannelHandle hChannel;
CSL_Edma3ParamSetup myParamSetup;
CSL_Edma3Context context;
CSL_Edma3ChannelAttr chAttr;
CSL_Edma3CmdQrae qraeSetup;
CSL_Status status;
Uint32 loopIndex;
/* Module initialization */
if (CSL_edma3Init(&context) != CSL_SOK)
{
printf ("Error: EDMA module initialization failed\n");
return -1;
}
/* Module level open */
hModule = CSL_edma3Open(&edmaObj,instNum,NULL,&status);
if ((hModule == NULL) || (status != CSL_SOK))
{
printf ("Error: EDMA module open failed\n");
return -1;
}
/* Is this for GLOBAL or SHADOW Region */
if (regionNum != CSL_EDMA3_REGION_GLOBAL)
{
/* Shadow Region: Enable DRAE enable(Bits 0-15) it. */
regionAccess.region = regionNum;
regionAccess.drae = 0xFFFF;
regionAccess.draeh = 0x0000;
if (CSL_edma3HwControl(hModule,CSL_EDMA3_CMD_DMAREGION_ENABLE, ®ionAccess) != CSL_SOK)
{
printf ("Error: EDMA region enable command failed\n");
return -1;
}
/* Enable access for all QDMA channels in the SHADOW Region. */
qraeSetup.region = regionNum;
qraeSetup.qrae = 0xFF;
if (CSL_edma3HwControl(hModule,CSL_EDMA3_CMD_QDMAREGION_ENABLE, &qraeSetup) != CSL_SOK)
{
printf ("Error: EDMA QDMA region enable command failed\n");
return -1;
}
}
regionIntr.region = regionNum;
regionIntr.intr = (1u << tcc);
regionIntr.intrh = 0;
CSL_edma3HwControl(hModule, CSL_EDMA3_CMD_INTR_ENABLE, ®ionIntr);
/* QDMA Channel Open */
chAttr.regionNum = regionNum;
chAttr.chaNum = channelNum;
hChannel = CSL_edma3ChannelOpen(&chObj, instNum, &chAttr, &status);
if ((hChannel == NULL) || (status != CSL_SOK))
{
printf ("Error: EDMA channel open failed\n");
return -1;
}
CSL_edma3HwChannelSetupParam (hChannel, myParam);
/* Setup the trigger word for the QDMA Channel. */
CSL_edma3HwChannelSetupTriggerWord(hChannel, CSL_EDMA3_TRIGWORD_SRC);
hParamPing = CSL_edma3GetParamHandle(hChannel, myParam, &status);
if (hParamPing == NULL)
{
printf ("Error: EDMA get handle for param entry 1 failed\n");
return -1;
}
/* Setup param entry */
myParamSetup.option = CSL_EDMA3_OPT_MAKE(CSL_EDMA3_ITCCH_DIS, \
CSL_EDMA3_TCCH_DIS, \
CSL_EDMA3_ITCINT_DIS, \
CSL_EDMA3_TCINT_EN,\
tcc,CSL_EDMA3_TCC_NORMAL,\
CSL_EDMA3_FIFOWIDTH_NONE, \
CSL_EDMA3_STATIC_EN, \
CSL_EDMA3_SYNC_A, \
CSL_EDMA3_ADDRMODE_INCR, \
CSL_EDMA3_ADDRMODE_INCR);
myParamSetup.srcAddr = (Uint32)srcBuff1;
myParamSetup.aCntbCnt = CSL_EDMA3_CNT_MAKE(256,1);
myParamSetup.dstAddr = (Uint32)dstBuff1;
myParamSetup.srcDstBidx = CSL_EDMA3_BIDX_MAKE(1,1);
myParamSetup.linkBcntrld= CSL_EDMA3_LINKBCNTRLD_MAKE(CSL_EDMA3_LINK_NULL,0);
myParamSetup.srcDstCidx = CSL_EDMA3_CIDX_MAKE(0,1);
myParamSetup.cCnt = 1;
if (CSL_edma3ParamSetup(hParamPing, &myParamSetup) != CSL_SOK)
{
printf ("Error: EDMA param setup failed\n");
return -1;
}
/* Enable Channel */
if (CSL_edma3HwChannelControl(hChannel,CSL_EDMA3_CMD_CHANNEL_ENABLE, NULL) != CSL_SOK)
{
printf ("Error: EDMA channel enable command failed\n");
return -1;
}
/* Trigger the word by writing to the trigger word... */
if (CSL_edma3ParamWriteWord(hParamPing,CSL_EDMA3_TRIGWORD_SRC,(Uint32)srcBuff1) != CSL_SOK) {
printf ("Error: EDMA param write word failed\n");
return -1;
}
/* Poll IPR bit */
regionIntr.region = regionNum;
do {
CSL_edma3GetHwStatus(hModule,CSL_EDMA3_QUERY_INTRPEND,®ionIntr);
} while (!(regionIntr.intr & (1 << tcc)));
/* Clear pending interrupt */
if (CSL_edma3HwControl(hModule,CSL_EDMA3_CMD_INTRPEND_CLEAR, ®ionIntr) != CSL_SOK)
{
printf ("Error: EDMA clear interrupt pend command failed\n");
return -1;
}
}
void main (void)
{
Uint8 channelNum = 16;
Int32 regionNum = 0;
Uint8 instNum = 0;
Int32 myParamNum = 1;
Uint8 tccNum = 0;
qdma_link_xfer_region(instNum, channelNum, regionNum , myParamNum, tccNum);
return;
}
upper code worked ok and QDMA is passed .we want to have interrupt of transfer complete on code so add this downner code:
Hwi_Params_init(&hwiParams);
hwiParams.enableInt = TRUE;
hwiParams.eventId = CSL_INTC0_CPU_2_EDMA3CCINT0;
hwi = Hwi_create(CSL_INTC0_CPU_2_EDMA3CCINT0, callbackFunc, &hwiParams, NULL);
if (hwi == NULL) {
System_printf("Hwi_create failed\n");
return -1;
}
but call back function never called. so what is the problem ?