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.

Question about EDMA initialization

Other Parts Discussed in Thread: OMAPL138, SYSBIOS

Hi,

I try to modify uart_edma example project to a SYSBIOS project on OMAPL138 LCDK. When I find some problems, I have to back to look into detail about EDMA configuration. 

The example project has the following code:

..........................

int main(void)
{
    volatile char enter[] = "\r\nPlease Enter 20 bytes from keyboard\r\n";
    volatile char buffer[RX_BUFFER_SIZE];
    unsigned int buffLength = 0;

    /* Initialize EDMA3 Controller */
    EDMA3Initialize();

    /* Initialize UART */
    UARTStdioInit();

    /* Request DMA Channel and TCC for UART Transmit*/
    EDMA3RequestChannel(SOC_EDMA30CC_0_REGS, EDMA3_CHANNEL_TYPE_DMA, 
                        EDMA3_CHA_UART2_TX, EDMA3_CHA_UART2_TX,
                        EVT_QUEUE_NUM);

    /* Registering Callback Function for TX*/
    cb_Fxn[EDMA3_CHA_UART2_TX] = &callback; 

    /* Request DMA Channel and TCC for UART Receive */
    EDMA3RequestChannel(SOC_EDMA30CC_0_REGS, EDMA3_CHANNEL_TYPE_DMA,
                        EDMA3_CHA_UART2_RX, EDMA3_CHA_UART2_RX,
                        EVT_QUEUE_NUM);

    /* Registering Callback Function for RX*/
    cb_Fxn[EDMA3_CHA_UART2_RX] = &callback; 

    /* Used for bCnt */
    buffLength = strlen((const char *) enter); 

    /* Transmit Data for Enter Message */
    UartTransmitData(EDMA3_CHA_UART2_TX, EDMA3_CHA_UART2_TX,
                     enter, buffLength);

    /* Enabling UART in DMA Mode*/
    UARTDMAEnable(SOC_UART_2_REGS, UART_RX_TRIG_LEVEL_1 |  \
                                   UART_DMAMODE |          \
                                   UART_FIFO_MODE );

    /* Wait for control to return from call-back function */

I try to split to one time 39 char EDMA transmission to two separate times EDMA transmission, but it fails. The code is:

    /* Transmit Data for Enter Message */
    UartTransmitData(EDMA3_CHA_UART2_TX, EDMA3_CHA_UART2_TX,
                     enter, buffLength-10);

    /* Enabling UART in DMA Mode*/
    UARTDMAEnable(SOC_UART_2_REGS, UART_RX_TRIG_LEVEL_1 |  \
                                   UART_DMAMODE |          \
                                   UART_FIFO_MODE );




    /* Transmit Data for Enter Message */
    UartTransmitData(EDMA3_CHA_UART2_TX, EDMA3_CHA_UART2_TX,
                     enter+10, 10);

    /* Enabling UART in DMA Mode*/
    UARTDMAEnable(SOC_UART_2_REGS, UART_RX_TRIG_LEVEL_1 |  \
                                   UART_DMAMODE |          \
                                   UART_FIFO_MODE );

In fact, it will send out the last 10 char if it continues run, or the first 29 char if steps over. Could you tell me the reason?

Thanks,

  • I notice that Uart use FIFO mode from EDMA configuration codes, but what trigger level in the Uart FIFO mode is? There is no doc about it yet. I would like to set it to 1 for a controllable send out 1 char every time now. Thanks,

        /* Initialize UART */
        UARTStdioInit();