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.

problems when transmit one byte by uart edma mode

hello

i got a problem when i used the uart edma mode.

according to starterware uart_edma, emda can not gernerate tx event after one and only one byte had been transmitted.

event enable set register bit was set, but no event occured.

this exists in starterware uart_edma example.

the best result is to link PaRam to itself, and when tx one byte,two bytes are transmitted, without dead tx interrupt.

what is the problem, or how to config edma to make it working correctly?

  • Hello Yang,

    Sorry for replying late.

    yang lin said:
    according to starterware uart_edma, emda can not gernerate tx event after one and only one byte had been transmitted.

    I did not understand the background of your above comment. Can you share the UART and EDMA configurations you are using? If you are using FIFO mode, also share the FIFO configurations.

    Thanks and Regards.

    Gurudutt.

  • hello

    thanks for replying.

    what I mean is that I tried the example project "uart_edma" from STARTERWARE-AM335X v2.00.00.07, and the results in no difference.

    It is uart0 without fifo.

    whenever I called the function below with length = 1,one byte was sent,but any invoking after this with any length, nothing was sent.

    if length >=2, nothing wrong happens.

    UartEDMATxConfTransfer(unsigned int tccNum,unsigned int chNum,volatile unsigned char *txBuffer,unsigned int length);

    /* Transmit DMA Threshold Value. */
    #define TX_DMA_THRESHOLD (8u)

    /* Receive DMA Threshold Value. */
    #define RX_DMA_THRESHOLD (1u)

    /* Receiver Buffer Size. */
    #define RX_BUFFER_SIZE (8u)

    /* EDMA3 Event queue number. */
    #define EVT_QUEUE_NUM (0u)

    /* PaRAM Set number for Dummy Transfer. */
    #define DUMMY_CH_NUM (5u)

    /* Wrapper Definitions. */
    #define UART_INSTANCE_BASE_ADD (SOC_UART_0_REGS)
    #define EDMA3_UART_TX_CHA_NUM (EDMA3_CHA_UART0_TX)
    #define EDMA3_UART_RX_CHA_NUM (EDMA3_CHA_UART0_RX)
    #define UART_INT_NUM (SYS_INT_UART0INT)

    static void UartEDMARxConfTransfer(unsigned int tccNum,
    unsigned int chNum,
    volatile unsigned char *rxBuffer,
    unsigned int length)
    {
    EDMA3CCPaRAMEntry paramSet;

    /* Fill the PaRAM Set with transfer specific information */
    paramSet.srcAddr = (unsigned int)UART_THR_RHR_REG;
    paramSet.destAddr = (unsigned int) rxBuffer;

    /* A, B and C Count values. */
    paramSet.aCnt = (unsigned short)RX_DMA_THRESHOLD;
    paramSet.bCnt = (unsigned short)length/RX_DMA_THRESHOLD;
    paramSet.cCnt = 1;
    paramSet.destBIdx = (short)RX_DMA_THRESHOLD;

    paramSet.srcBIdx = 0;
    paramSet.srcCIdx = 0;
    paramSet.destCIdx = 0;

    paramSet.linkAddr = 0xFFFF;
    paramSet.bCntReload = 0;

    /* OPT PaRAM Entries. */
    paramSet.opt = 0x00000000u;

    /* Source and Destination addressing modes are Incremental. */

    /* Setting the Transfer Complete Code(TCC). */
    paramSet.opt |= ((tccNum << EDMA3CC_OPT_TCC_SHIFT) & EDMA3CC_OPT_TCC);

    /* Enabling the Completion Interrupt. */
    paramSet.opt |= (1 << EDMA3CC_OPT_TCINTEN_SHIFT);

    /* Now write the PaRAM Set */
    EDMA3SetPaRAM(SOC_EDMA30CC_0_REGS, chNum, &paramSet);

    /* Enable EDMA Transfer */
    EDMA3EnableTransfer(SOC_EDMA30CC_0_REGS, chNum, EDMA3_TRIG_MODE_EVENT);
    }

  • hello Set before EDMA3EnableTransfer () to force EDMA3SetEvt ().
    Just your EDMA cannel controller missing event of UART