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.

EDMA configuration with UART (OMAP L138)

hey guys..

this question is regarding the OMAP L138 using edma and uart

i've been trying to configure the EDMA to work with uart to continuesly get frames with no luck

i work ontop of the edma_uartEcho.c example that's included in the StarterWare kit

edma3ComplHandler, edma3CCErrHandler functions left with no change

what i try to achieve is continuesly get data from UART which is connect to a device that sends 460800baud rate data nonstop

i tried to set aCnt = 1, bCnt = 2112, cCnt = 3

what happends is i get one frame of 2112(bCnt) and i stop getting the rest of the frame and completion interrupt is never triggered...

if i change bCnt to 8192 i do manage to get all those frames the completion interrupt is triggered but i also get a big buffer overflow....

changing to cCnt = 1 will give me missing Event error...

EDMA3CCPaRAMEntry paramSet;

int main(void){
    unsigned char buffer2[RX_BUFFER_SIZE];
    EDMA3RequestChannel(SOC_EDMA30CC_0_REGS, EDMA3_CHANNEL_TYPE_DMA,
    EDMA3_CHA_UART1_RX, EDMA3_CHA_UART1_RX,
    EVT_QUEUE_NUM);
    UartReceiveData2(EDMA3_CHA_UART0_RX, EDMA3_CHA_UART0_RX, buffer2);
    UARTCharPut(SOC_UART_0_REGS, 'K');
    EDMA3SetPaRAM(SOC_EDMA30CC_0_REGS, EDMA3_CHA_UART0_RX, &paramSet);
    EDMA3EnableTransfer(SOC_EDMA30CC_0_REGS, EDMA3_CHA_UART0_RX, EDMA3_TRIG_MODE_EVENT);
    UARTDMAEnable(SOC_UART_0_REGS, UART_RX_TRIG_LEVEL_1 | \
                                       UART_DMAMODE | \
                                        UART_FIFO_MODE);


while(1){
   while(0 == flag2);
   flag2 = 0;
   EDMA3EnableTransfer(SOC_EDMA30CC_0_REGS, EDMA3_CHA_UART0_RX, EDMA3_TRIG_MODE_EVENT);
   }


   EDMA3FreeChannel(SOC_EDMA30CC_0_REGS, EDMA3_CHANNEL_TYPE_DMA,
                                          EDMA3_CHA_UART0_RX, EDMA3_TRIG_MODE_EVENT,
                                          EDMA3_CHA_UART0_RX, EVT_QUEUE_NUM);
}

static void UartReceiveData2(unsigned int tccNum, unsigned int chNum,
volatile char *buffer)
{
/* Fill the PaRAM Set with transfer specific information */
      paramSet.srcAddr = UART_RBR_THR_REG2; ((0x01C42000u) + (0u))
      paramSet.destAddr = (unsigned int) buffer;
      paramSet.aCnt = MAX_ACNT; 1
      paramSet.bCnt = MAX_BCNT; 2112
      paramSet.cCnt = MAX_CCNT; 3


/* The src index should not be increment since it is a h/w register*/
      paramSet.srcBIdx = 0;
/* The dest index should incremented for every byte */
      paramSet.destBIdx = 1;

/* A sync Transfer Mode */
      paramSet.srcCIdx = 0;
      paramSet.destCIdx = 1;
      paramSet.linkAddr = (unsigned short)0xFFFFu;
//paramSet.linkAddr = (unsigned short)0x1u;
      paramSet.bCntReload = 0;
      paramSet.opt = 0x00000000u;
//paramSet.opt |= ((tccNum << EDMA3CC_OPT_TCC_SHIFT)); // & EDMA3CC_OPT_TCC);
      paramSet.opt |= (1 << EDMA3CC_OPT_TCINTEN_SHIFT);
//paramSet.opt |= (1 << EDMA3CC_OPT_SYNCDIM_SHIFT);
}

hope you guys could clear out for me the interaction with the acnt,bcnt,ccnt and the completion interrupts and maybe figure out what i was doing wrong...

thanks in Advance

Maor