the purpose is to move 20 * bit32 from a FPGA FIFO to a internal circular buffer.(count = 32).
The C6711D get the external int 7 as the event and trigger an EDMA interrupt for each fame. After the EDMA param is exhausted, it will reload the param via a link.
Please help check the code and find what is the error.
void InitDMAExtint7()
{
UINT32 i;
volatile UINT32 *edma_ptr;
/*set event selector, default extint7 using channel 7*/
/*clear pending flag*/
EDMA_CIPR = 0xffffu;
/*enable channel interrupt*/
//EDMA_CIER = 0x1u << 7;
/*no chain for channel 7*/
EDMA_CCER = 0;
/*disable event 7*/
EDMA_EER &= ~(1 << 7);
/*clear EDMA channel 7 param*/
edma_ptr = (UINT32*)&EDMA_7;
for(i = 0; i < 6; i ++) {
*edma_ptr ++ = 0x00000000;
}
EDMA_ECR = 0x1u << 7;
}
void SetDMA7()
{
//UINT32 index ;
volatile EDMA_PaRAM *pEDMA = (volatile EDMA_PaRAM *)&EDMA_7;
volatile EDMA_PaRAM *pEDMA_Link = (volatile EDMA_PaRAM *)&EDMA_8;
/*disable event 7*/
EDMA_EER &= ~(1 << 7);
//index = (DatasDMA.IndiceEntree + 1) & (ET_C_SIZE_ELTS_FILES - 1);
/*OPT: PRI=2 ESIZE=0 2DS =0 SUM=11 2DD =0 DUM=1 TCINT=1 TCC=7 LINK=1 FS=1*/
pEDMA->opt = 0x43370003;
/*RSC = FPGA FIFO*/
pEDMA->src = ET_C_MAC_BASE;
/*CNT: FRMCNT =1 ELECNT = count of 32bit in a frame*/
pEDMA->cnt = ((ET_C_SIZE_ELTS_FILES-1) << 16)|ET_C_SIZE_FRAME;
/*DST: DATADMA point */ /*write to next buffer,inc index after transfer*/
pEDMA->dst = (UINT32)DatasDMA.FileCirculaire;
/*IDX: 0*/
pEDMA->idx = 0x00000004;
/*RLD: 0 */
pEDMA->div = (EDMA_PaRAM_EVT8 & 0xffff);
pEDMA_Link->opt = pEDMA->opt;
pEDMA_Link->src = pEDMA->src;
pEDMA_Link->cnt = pEDMA->cnt;
pEDMA_Link->dst = pEDMA->dst;
pEDMA_Link->idx = pEDMA->idx;
pEDMA_Link->div = pEDMA->div;
/*enable event 7*/
EDMA_EER |= 0x1u << 7;
}