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.

TM4C1294NCPDT: DMA Transfer to UART Peripheral sending Random Bytes

Part Number: TM4C1294NCPDT

Hello Team,

I'm Working on DMA Transfer to UART Peripheral in TM4C1294NCPDT(Customised Board). Facing issue while sending bytes from Pkt2(Array of size 312 bytes) to another Controller. But the Problem is DMA transfer function is not working as expected it is sending random bytes compared to actual bytes.
 
1) I'm Filling an Array in one Function to Transmit those bytes to another controller.
2) After Filling 312 bytes in an Array(Pkt2 named in Program), I'm Using " MAP_uDMAChannelEnable(UDMA_CH17_UART3TX);" to initiate DMA Transfer.
3) Where it is going wrong i was unable to recognise. Can Someone help me how DMA is working in this scenario and Help me  to resolve this issue.
I want to send 312 data bytes from internal Array(Pkt2) to Another Micro-Controller without any data loss using DMA_Tx. 

Attaching configuration for both DMA Rx and Tx and Also Output i got. Any help would be very thankful. 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void Init_UART3()
{
//
// Enable the GPIO Peripheral used by the UART.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
//
// Enable UART3.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART3);
//
// Enable processor interrupts.
//
IntMasterEnable();
//
// Configure GPIO Pins for UART mode.
//
GPIOPinConfigure(GPIO_PA4_U3RX);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Below is the DMA transferred Data which is very random/ Not Expected Data to transfer.

  • Helo Vamshi,

    Trying using UDMA_SIZE_8 instead of UDMA_SIZE_16. I think you are getting garbage data because you are trying to send 16 bits when the buffer sends data in 8-bit increments. That is also why UDMA_ARB_4 is used instead of UDMA_ARB_2.

    Best Regards,
    Ralph Jacobi

  • Thank you for the reply Ralph Jacobi,

    I have referred TM4C datasheet then i got to know that,

    My Array size is 16 So, I have to use UDMA_SIZE_16 as well as source increment to UDMA_SRC_INC_16 only.
    Here Major role is Arbitration which i need to set to  UDMA_ARB_1 for not missing data.


    " uDMAChannelControlSet(UDMA_CH17_UART3TX | UDMA_PRI_SELECT , UDMA_SIZE_16 |
                                              UDMA_SRC_INC_16 | UDMA_DST_INC_NONE | UDMA_ARB_1); "

    The parameters in the above function resolved my issue.

    Thank you,
    Vamshi

  • Hello Vamshi,

    Ahh I see, I didn't notice the mismatch on UDMA_SRC_INC_8 and UDMA_SRC_INC_16 for RX and TX. For the Arbitration, you may be able to use higher ones if you increase the RX FIFO trigger so it isn't flagging the DMA for transfer too quickly. Our example code uses UART_FIFO_RX4_8 and UART_FIFO_TX4_8 to then use UDMA_ARB_4.

    Best Regards,

    Ralph Jacobi

  • Yes, Thank you for the information Ralph Jacobi.