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.

RTOS: Trouble with tm4c udma peripheral interface : uart tx/rx FIFO

Other Parts Discussed in Thread: TM4C1294NCPDT

Tool/software: TI-RTOS

Hi all, 

  I'm using tm4c1294ncpdt board.I want to use the uart with udma.The datasheet shows: Peripherals with FIFOs serviced by the uDMA to transmit or receive data.So I want to use the uart rx fifo to trigger a transfer request. My trouble is tm4c has no available uart fifo address.The proess of  transfering and receiving data by FIFOs is to read and wrtite UARTDR  register instead.  So how can I fill the scr address in the function:uDMAChannelTransferSet(); I just fill it with the address of  UARTDR  register.My program as follows:

BIOS_getCpuFreq(&sysfreq);

/* UART7 as RS485_3 */
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART7);
GPIOPinConfigure(GPIO_PC4_U7RX);
GPIOPinConfigure(GPIO_PC5_U7TX);
GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_4 | GPIO_PIN_5);
UARTConfigSetExpClk(UART7_BASE, sysfreq.lo, baud, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
UARTEnable(UART7_BASE);
UARTIntEnable(UART7_BASE, UART_INT_DMARX);
UARTFIFOLevelSet(UART7_BASE,UART_FIFO_TX1_8, UART_FIFO_RX4_8);
IntEnable(INT_UART7);
UARTDMAEnable(UART7_BASE, UART_DMA_RX);
UARTIntClear(UART7_BASE, UART_INT_DMARX);

SysCtlPeripheralEnable(SYSCTL_PERIPH_UDMA);
uDMAEnable();
uDMAControlBaseSet(&MyDMAControlTable[0]);
uDMAChannelAssign(UDMA_CH20_UART7RX);
uDMAChannelAttributeEnable(UDMA_CH20_UART7RX, UDMA_ATTR_USEBURST | UDMA_ATTR_HIGH_PRIORITY );
uDMAChannelControlSet(UDMA_CH20_UART7RX | UDMA_PRI_SELECT, UDMA_SIZE_8 | UDMA_SRC_INC_8 | UDMA_DST_INC_8 | UDMA_ARB_8 | UDMA_NEXT_USEBURST);
uDMAChannelTransferSet(UDMA_CH20_UART7RX | UDMA_PRI_SELECT, UDMA_MODE_BASIC, (void *)(UART7_BASE + UART_O_DR), receivebuffer_runtime, UDMA_SIZE_8); 
uDMAChannelEnable(UDMA_CH20_UART7RX); 
uDMAChannelRequest(UDMA_CH20_UART7RX); 

How to do witn the udam scr address with uart fifo ? 

How can I use the udam with uart fifo in a right way ? The peripheral fifo is a effient way to tigger udma in burst mode, so I need the way to improve my uart udma efficiency.

  • Hi Nancy,

    A couple of comments:

    - The register UART7_BASE + UART_O_DR is exactly what you think that "does not exist": a memory address. Just like any other location that can be used as dma parameters.

    - On the DMA configuration, you should NOT increase the source with 8. Leave the source constant, because you will always execute the DMA transfer from the same location. Of course, you do want to increase the destination, so that each new incoming byte occupies the next position on your buffer.

    Further, I was going to say that on your line UARTIntEnable(UART7_BASE, UART_INT_DMARX), the parameter UART_INT_DMARX is not valid - BUT that is not true, it is a valid parameter defined on uart.h. Hence, TI FELLOWS, shouldn't you make a note and fix entry 30.2.2.30 of TivaWare user guide?

    Finally, I believe you should also add UART_INT_RT to your list of interrupts (but honestly I'm not sure about it, as we decided that our uart drivers don't use dma, hence it's been a while we did such tests).

    Bruno
  • Poster Bruno has made several good & valid points - yet I feel a BIGGER ONE has remained "silent!"

    Achieving your goal of, "µDMA engaged UART" is among the "most difficult" of program challenges. And yet - it would appear - this is your chosen, "Starting Point."    And that is NOT KISS!      And is almost certain to "over-challenge!" (as it has - noted by your post)

    Bruno picked up your confusion as regards (both) "µDMA Source & Destination Addressing" - had you "started" with the "simplest Peripheral" - your odds of noting such would have been much higher.

    You note, "More you learn - more you understand" - yet "KISS" represents (by far) the best "means to that end!"      Climbers (rarely) choose Mt. Kilimanjaro as "first climb."      "Climbers/users" (here) are advised to seek an easier "hill/peripheral" - which REALLY aids learning & understanding...      

    Complexity is NOT your friend - at least not here - and not now!     KISS!

  • Hi cb1_mobile and Bruno,
    Thanks a lot !
    Thanks to your reminders, whether it is technically or in other aspects, I have succeeded in uart rx_timeout interrupt and udma trigger uart tx.
    In futuer, I may use more ti-designed chips and may have more questions .Standing in users, we may have a mis-understanding of your descriptions in the datasheet.And we may use many different mcus form different Manufactors.Each Manufactor has their designation and prefer.When we use the chip peripherals for the first time, we may use them in wrong ways. Actions louder than words.
    I will close the post.
  • Your "muscle memory" may wish to replace (repeated) "udam" w/proper "udma" before that "habit" becomes too grooved!    (µDMA really)

    Poster Nancy wrote: (a true copy)

    How to do with the udam scr address with uart fifo ? 

    How can I use the udam with uart fifo in a right way ?