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.

TDA4AL-Q1: How to configure UART to use DMA for data transmission?

Part Number: TDA4AL-Q1


Tool/software:

In the current design, the TX/RX of TDA4AL's main_uart6 and the RX of main_uart7 are connected to the MCU. The baud rate for main_uart6 is set to 115200, and for main_uart7, it is set to 3125000. Since there are some transmission issues, we would like to try using UART DMA to see if it can help improve the situation. How can we configure UART DMA?

Thanks.

  • Hello Eddi,

    The assigned engineer is on business travel this week, so please expect a delay in response on this thread.

    Thank you,

    AlanL

  • Hi Eddi,

    Since there are some transmission issues

    What are the transmission issues you are encountering?

    Additionally, if you are using RTOS, please take a look at the UART example within the PDK on more information on using the UART peripheral as well as enabling DMA.

    Thanks,

    Neehar

  • Hi Neehar,

    The transmission issue has been resolved earlier, but we may consider enabling DMA in the future. Currently, based on the source code, it seems that we need to add the dmas and dma-names parameters in the device tree.

    However, since I am unsure how to fill in the parameters for dmas related to main_uart6 and main_uart7, could you please assist with providing detailed instructions on how to enable DMA for main_uart6 and main_uart7?

    Also, our operating system is Linux and we are using Yocto interface.

    Thanks.

  • Hi Eddi,

    I currently do not have bandwidth and will follow up by the end of the week. Thank you for your patience!

    Thanks,

    Neehar

  • Hi Eddi,

    Take a look at the configuration below as an example:

    &main_uart1 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_uart1>;
        dmas = <&main_pktdma 0x4401 0>, <&main_pktdma 0xc401 0>;
        dma-names = "rx", "tx";
        status = "okay";
    }

    Thanks,

    Neehar

  • Hi Neehar,

    What values should be specified for the dmas property of main_uart6 and main_uart7 in the device tree?

    Thanks,

    Eddie

  • Hi Eddie,

    It will depend on the dma-controller you wish to use and how many dma-cells are stated.

    The first value is the dma-controller you want to use for DMA and based on this, you can check the .yaml file for the rest.

    For example for main_pktdma it says:

    "#dma-cells":
    const: 2
    description: |
    The first cell is the PSI-L thread ID of the remote (to PKTDMA) end.
    Valid ranges for thread ID depends on the data movement direction:
    for source thread IDs (rx): 0 - 0x7fff
    for destination thread IDs (tx): 0x8000 - 0xffff

    Please refer to the device documentation for the PSI-L thread map and also
    the PSI-L peripheral chapter for the correct thread ID.

    The second cell is the ASEL value for the channel
    The .yaml file can be found at: ti-processor-sdk-linux-adas-j721s2-evm-10_01_00_04/board-support/ti-linux-kernel-6.6.44+git-ti/Documentation/devicetree/bindings/dma/ti

    Thanks,

    Neehar