Hi all,
I am using C6748 for a university project.
I am trying to use activate the edma3 to transfer samples from the Edma to Left and right ping pong buffers.
Here are the steps I took:
1. configure Mcasp without starting it.
2. Edma3: requesting 3 channels: 1. active 2. linking channel -for ping buffer and 3. linking channel for pong
3. setting the channels parameters using 2 Pset's one for ping and one for pong.
4. enabling the transfer
5. starting Mcasp
It don't receive any response from the Edma, it seems that it does not start at all!
I attached two of my configuration files-
Is there something wrong with my configuration/procedure?
thanks in advance!
Ariel
EDMA3_DRV_PaRAMRegs ParamSetRcvPing = {0,0,0,0,0,0,0,0,0,0,0,0}; EDMA3_DRV_PaRAMRegs ParamSetRcvPong = {0,0,0,0,0,0,0,0,0,0,0,0}; unsigned int EdmaActiveRcvChannelId,EdmaLinkRcvChannelIdPing,EdmaLinkRcvChannelIdPong; unsigned int EdmaTccPing=0,EdmaTccPingLink=0,EdmaTccPongLink = 0; dstBuffping = (signed char*)_dstBuffping; dstBuffpong = (signed char*)_dstBuffpong; /*********************************************************************************** * step 1: request 3 channels: * 1. 1 Active channel * 2. two linking channels for ping & pong buffers * *********************************************************************************/ /* Setup for Channel 1*/ EdmaTccPing = EDMA3_DRV_TCC_ANY; EdmaTccPingLink = EDMA3_DRV_TCC_ANY; EdmaTccPongLink = EDMA3_DRV_TCC_ANY; EdmaActiveRcvChannelId = EDMA3_DRV_HW_CHANNEL_EVENT_0; //McAsp receive EdmaLinkRcvChannelIdPing = EDMA3_DRV_LINK_CHANNEL; EdmaLinkRcvChannelIdPong = EDMA3_DRV_LINK_CHANNEL; /* 3 Receive channels */ if (result == EDMA3_DRV_SOK) { result = EDMA3_DRV_requestChannel (hEdma, &EdmaActiveRcvChannelId, &EdmaTccPing,(EDMA3_RM_EventQueue)0, &callback1, NULL); } if (result == EDMA3_DRV_SOK) { result = EDMA3_DRV_requestChannel( hEdma, &EdmaLinkRcvChannelIdPing, &EdmaTccPingLink, (EDMA3_RM_EventQueue)0, &callback1, NULL ); } if (result == EDMA3_DRV_SOK) { result = EDMA3_DRV_requestChannel( hEdma, &EdmaLinkRcvChannelIdPong, &EdmaTccPongLink, (EDMA3_RM_EventQueue)1, &callback1, NULL ); } /*********************************************************************************** * step 2: configure paramsets for the 3 channels: * The active channel and the ping channel have the same param sets. * The pong channel has a different destination address **********************************************************************************/ /* set parameters for the 3 receive channels */ /* Fill the PaRAM Set with transfer specific information */ ParamSetRcvPing.srcAddr = (unsigned int)(&MCASP->XBUF12); ParamSetRcvPong.srcAddr = (unsigned int)(&MCASP->XBUF12); ParamSetRcvPing.destAddr = (unsigned int)(dstBuffping); //change destination address ParamSetRcvPong.destAddr = (unsigned int)(dstBuffpong); /* Bidx/Cidx - between -32767 and 32767*/ ParamSetRcvPing.srcBIdx = 0; ParamSetRcvPong.srcBIdx = 0; ParamSetRcvPing.destBIdx = 2048; ParamSetRcvPong.destBIdx = 2048; ParamSetRcvPing.srcCIdx = 0; ParamSetRcvPong.srcCIdx = 0; ParamSetRcvPing.destCIdx = -2046; ParamSetRcvPong.destCIdx = -2046; /* ACnt/BCnt/CCnt- between 0 and 65535 */ ParamSetRcvPing.aCnt = acnt; ParamSetRcvPong.aCnt = acnt; ParamSetRcvPing.bCnt = bcnt; ParamSetRcvPong.bCnt = bcnt; ParamSetRcvPing.cCnt = ccnt; ParamSetRcvPong.cCnt = ccnt; /* For AB-synchronized transfers, BCNTRLD is not used. */ ParamSetRcvPing.bCntReload = BRCnt; ParamSetRcvPong.bCntReload = BRCnt; ParamSetRcvPing.linkAddr = 0xFFFFu; ParamSetRcvPong.linkAddr = 0xFFFFu; /* Src & Dest are in INCR modes */ ParamSetRcvPing.opt &= 0xFFFFFFFCu; ParamSetRcvPong.opt &= 0xFFFFFFFCu; /* Program the TCC */ ParamSetRcvPing.opt |= ((EdmaTccPing << OPT_TCC_SHIFT) & OPT_TCC_MASK); ParamSetRcvPong.opt |= ((EdmaTccPongLink << OPT_TCC_SHIFT) & OPT_TCC_MASK); /* Enable Final transfer completion interrupt */ //ParamSetRcvPing.opt |= (1 << OPT_ITCINTEN_SHIFT); ParamSetRcvPing.opt |= (1 << OPT_TCINTEN_SHIFT); ParamSetRcvPong.opt |= (1 << OPT_TCINTEN_SHIFT); ParamSetRcvPing.opt &= 0xFFFFFFFBu; ParamSetRcvPong.opt &= 0xFFFFFFFBu; /* Now, write the PaRAM Set. */ if (result == EDMA3_DRV_SOK) { result = EDMA3_DRV_setPaRAM(hEdma, EdmaActiveRcvChannelId, &ParamSetRcvPing); } if (result == EDMA3_DRV_SOK) { result = EDMA3_DRV_setPaRAM(hEdma, EdmaLinkRcvChannelIdPing, &ParamSetRcvPing); } if (result == EDMA3_DRV_SOK) { result = EDMA3_DRV_setPaRAM(hEdma, EdmaLinkRcvChannelIdPong, &ParamSetRcvPong); } /*********************************************************************************** * step 3: link channels * The active channel should be linked to the pong channel * The pong channel should be linked to the ping channel **********************************************************************************/ if (result == EDMA3_DRV_SOK) { result = EDMA3_DRV_linkChannel( hEdma, EdmaActiveRcvChannelId, EdmaLinkRcvChannelIdPong ); } if (result == EDMA3_DRV_SOK) { result = EDMA3_DRV_linkChannel( hEdma, EdmaLinkRcvChannelIdPong, EdmaLinkRcvChannelIdPing ); } if (result == EDMA3_DRV_SOK) { result = EDMA3_DRV_enableTransfer (hEdma, EdmaActiveRcvChannelId, EDMA3_DRV_TRIG_MODE_EVENT); } McASP_Start_TTO(); // start McASP clocks