Ttl uart lost data error

What do you mean by “can not start DMA”? My concern is that the end user software does not start or stop DMA…if you use a ttyTHS# the driver automatically uses DMA. The end software has no choice.

Is this custom hardware/carrier board?

yes,the carrier board is designed by us
If the device tree is not modified, the DMA names display txnano. If I remove the DMA name = “TX”, the DMA names display txrxnano

I can’t test the uart using your method, because when I tested the problem, it was more than 100000 * 120 byte,then the problem occurred. That is to say, I sent about 150 packet for 100000 bytes per packet

Original device tree:then the error log:ttyTHS ttyTHS2: 2 input overrun(s)
serial@70006200 { /* UART-C : UART3 : M.2 Key E /
compatible = “nvidia,tegra114-hsuart”;
dma-names = “tx”;
nvidia,adjust-baud-rates = <921600 921600 100>;
status = “okay”;
};
I modify it as the following:
serial@70006200 { /
UART-C : UART3 : M.2 Key E */
compatible = “nvidia,tegra114-hsuart”;
nvidia,adjust-baud-rates = <921600 921600 100>;
status = “okay”;
};
finish modify,the error log:
root@nano-desktop:/media/uart# ./uart_read /dev/ttyTHS2 115200
[46773.260294] dma dma0chan9: Dma length/memory address is not supported
[46773.266974] serial-tegra 70006200.serial: Not able to get desc for Rx
[46773.274467] serial-tegra 70006200.serial: Not able to start Rx DMA
[46773.280772] serial-tegra 70006200.serial: Uart HW init failed, err = -5
Open com success!!!
Input/output error [serial.cpp:70]

I don’t have the knowledge to completely solve this on a custom carrier board. In part this would depend on how your carrier board differs from the reference board, both electrically and in device tree.

FYI, if you edit your post and add three backquotes above and then three backquotes below your content it will preserve formatting and add a scrollbar. Example (note the single line above and below the block which is “```”):
```

serial@70006200 { /* UART-C : UART3 : M.2 Key E <em>/
compatible = “nvidia,tegra114-hsuart”;
dma-names = “tx”;
nvidia,adjust-baud-rates = <921600 921600 100>;
status = “okay”;
};

```

The following is from an NX and not a Nano, but it should have very similar device trees. The particular port on the NX is for a “/dev/ttyTHS” port:

        serial@3110000 {
                compatible = "nvidia,tegra186-hsuart";
                clocks = <0x4 0x9c 0x4 0x66>;
                resets = <0x5 0x65>;
                dma-coherent;
                clock-names = "serial", "parent";
                status = "okay";
                interrupts = <0x0 0x71 0x4>;
                dma-names = "rx", "tx";
                phandle = <0xe9>;
                nvidia,memory-clients = <0xe>;
                reg = <0x0 0x3110000 0x0 0x10000>;
                iommus = <0x2 0x20>;
                dmas = <0x19 0x9 0x19 0x9>;
                reg-shift = <0x2>;
                reset-names = "serial";
                linux,phandle = <0xe9>;
        };

Someone else can probably say more about what is required, but does yours have the “dma-coherent”? It is also a mistake to have only “tx” in “dma-names”. It should be:

dma-names = "rx", "tx";

It is hard for DMA to work if only half can be found.

A speed of 500000 may not work as expected. Does anything change if you use 115200?

There’s no problem in reducing the rate. Now I control the speed to send data to solve this problem

I ran the program for 5 * 24 hours. I first use it like this

thanks