Hi,
I am having an issue where my EDMA interrupt handler routine is never being called. I am setting up an EDMA transfer to read data off an FPGA FIFO. I use EDMA_intHook() to hook in the ISR function to the tcc. Here is my setup and code below:
initializeEMIFB()
{
emifRxEDMASem = SEM_create(0, 0);
int readTcc = EDMA_intAlloc(-1);
if ((readTcc != -1) && (0 != emifRxEDMASem))
{
emifReadEdmaConfig.opt = EDMA_OPT_RMK(
EDMA_OPT_PRI_LOW,
EDMA_OPT_ESIZE_16BIT,
//EDMA_OPT_ESIZE_32BIT,
EDMA_OPT_2DS_NO,
EDMA_OPT_SUM_NONE,
EDMA_OPT_2DD_NO,
EDMA_OPT_DUM_INC,
EDMA_OPT_TCINT_YES,
EDMA_OPT_TCC_OF( readTcc & 0x0F),
EDMA_OPT_TCCM_OF( (readTcc >> 4) & 0x03 ),
EDMA_OPT_ATCINT_DEFAULT,
EDMA_OPT_ATCC_DEFAULT,
EDMA_OPT_PDTS_DEFAULT,
EDMA_OPT_PDTD_DEFAULT,
EDMA_OPT_LINK_YES,
EDMA_OPT_FS_YES );
emifReadEdmaConfig.src = (Uint32) RX_FIFO_DATA;
emifReadEdmaConfig.idx = EDMA_IDX_OF( 0 );
emifReadEdmaConfig.rld = EDMA_RLD_OF( 0 );
EDMA_intHook(readTcc, (EDMA_IntHandler) EmifMsgEdmaRxCmpltIsr);
EDMA_intEnable(readTcc);
EDMA_intClear(readTcc);
}
ISR code:
void EmifMsgEdmaRxCmpltIsr(int tcc)
{
EDMA_intClear(tcc);
SEM_post(emifRxEDMASem);
}
execution of read code:
emifReadEdmaConfig.cnt = readDataLength*2;
emifReadEdmaConfig.dst = (Uint32)&dmaReadBuffer[0];
//Check to make sure there IS a length!
if (emifReadEdmaConfig.cnt)
{
//Invalidate the cache
CACHE_invL2(reinterpret_cast<unsigned short*>(&dmaReadBuffer[0]), readDataLength*4, CACHE_WAIT);
// QEDMA the data
EDMA_qdmaConfig(&emifReadEdmaConfig);
// Wait for EDMA completion (release the CPU for others)
SEM_pend(emifRxEDMASem, SYS_FOREVER);
.... }
and so it never returns from the SEM_pend, and I've set a breakpoint in the EmifMsgEdmaRxCmpltIsr() function, which never gets hit.
I've verified that the DMA is working though, because without the SEM_pend I do get data placed in the buffer from the FPGA, but sometimes it places zeros (or maybe nothing), which is leading me to believe I am accessing the buffer before the DMA completes. Hence why I would like to add in the SEM_pend and ISR functionality.