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.

KEYSTONE 2 EDMA TO UART PARAM REGISTER SETUP

I am trying to output data to a UART using EDMA.  I can EDMA from memory to memory but I cannot EDMA from a memory buffer to the UART.  If I use PARAM OPT with DAM set (destination is FIFO) with FWID set to 8 every 4th character comes out out the UART.  If I do not use DAM then I only get one charcater and the EDMA does not complete.

When I set the DAM bit in OPT, I use acnt=bytes, bcnt=1, ccnt=1.  When I do not use DAM, I use acnt=1, bcnt=bytes, ccnt=1, srcbidx=1.  Which method is correct.  I have looked at other peripheral examples and they seem not to use DAM or SAM.

  • Hi,

    Thanks for your post.

    If you set SAM/DAM = 0 (Increment mode) which indicates the source and destination wouldn't use FIFO, instead, if you set SAM/DAM =1 (constant addressing mode), the source and destination addressing would use FIFO and FIFO Width (FWID) is applicable only if either SAM or DAM is set to constant addressing mode.

    In general, For DAM in increment mode, there are no alignment restrictions imposed by EDMA3 but in constant addressing mode, you should program the destination address to be aligned to a 256-bit aligned address (5 LSBs of address must be 0) and the corresponding BIDX should be an even multiple of 32 bytes (256 bit).  The EDMA3CC does not recognize errors here, but the EDMA3TC asserts an error if this is not true. Please refer section 2.12.3 for additional details from the keystone 2 EDMA user guide below:

    http://www.ti.com/lit/ug/sprugs5b/sprugs5b.pdf

    You can poll for the errors, as the status of the errors can be read from the ERRSTAT registers. Additionally, if the error bits are enabled in the ERREN register, a bit set in the ERRSTAT will cause the error condition to interrupt the DSP(s). TRERR would be detected if it violates constant addressing mode transfer (SAM or DAM is set) alignment rules or has ACNT or BCNT == 0. Please see section 4.3.4.1 for error status register (ERRSTAT) from the above guide.

    Please see section 2.3.8 from the EDMA3 user guide to see the Note below:

    Note: The constant addressing (CONST) mode has limited applicability. The EDMA3 should be configured for the constant addressing mode (SAM/DAM = 1) only if the transfer source or destination (on-chip memory, off-chip memory controllers, slave peripherals) support the constant addressing mode. See the device-specific data manual and/or peripheral user's guide to verify if constant addressing mode is supported. If constant addressing mode is not supported, the similar logical transfer can be achieved using the increment (INCR) mode (SAM/DAM = 0) by appropriately programming the count and indices values.

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question

    -------------------------------------------------------------------------------------------------------

  • OK, so I have set DAM=0, ACNT=1, BCNT=bytes, CCNT=1, SRCBIDX=1, DSTBIDX=0, SRCCIDX=0, DSTCIDX=1 and using A SYNC (not AB SYNC).  When I start the DMA to the UART from memory I get the first character from the char buffer output by the UART and no others.  This is true no matter if I enable DMAMODE1 or not in the UART registers.  Which of my DMA parameters is wrong or is it something related to the UART ?

  • Ok, so I now have DMA almost working to the UART.  My problem now is that it either fails to start the DMA or it DMAs the first two characters twice before DMAing the whole message and completing the DMA transfer. So for example my text is "DMA TEST STRING" and the output from the UART is "DMDMA TEST STRING".