Nano ttyTHS1 receive data lost

9600 is not HIGH baudrate.
We measured the real baud rate in oscilloscope, our device is 9671, the error is 0.7%, it cause lost byte or receive error data. But if we short the rx/tx pins of Nano, it works fine. The real baud rate is 9615 for now.

How many baud rate tolerance is accept for Nano?

Thanks for your help!!

The problem confirmed.
When we set the baud rate to 9670, all errors gone.
But we can’t use it as solution, because the frequency error is random value.

So how to resolve this problem?
Is there some docuemnt list the uart baud rate tolerance?

Thank you!

Hi, Jerry

The driver for “nvidia,tegra114-hsuart” is serial-tegra.c.
There is “baud_tolerance” In the driver and it’s value input from dts “nvidia,adjust-baud-rates” entry.

Is there a way allow us set the tolerance in the code?

hello felixch,

it’s configure in the device tree property settings,
for example, nvidia,adjust-baud-rates = <115200 115200 100>; the 3rd column means it has 1% deviation.

Hi, Jerry

We try to set the dts “nvidia,adjust-baud-rates” to “9600, 115200, 200” ,But the errors still there.
Would you like to reproduce this issue? Use two nano module for send and receive, then set different baud rate for them.

Thank you!

Hi, jerry

In the driver code :

static long tegra_get_tolerance_rate(struct tegra_uart_port *tup,
		unsigned int baud, long rate)
{
	int i;

	for (i = 0; i < tup->n_adjustable_baud_rates; ++i) {
		if (baud >= tup->baud_tolerance[i].lower_range_baud &&
			baud <= tup->baud_tolerance[i].upper_range_baud)
			return (rate + (rate *
				tup->baud_tolerance[i].tolerance) / 10000);
	}

	return rate;
}

The tolerance just simple as a COEFFICIENT. That not “tolerance” meaning.

We found some words in Linux official docuemnt:

Baud Rate tolerance:
Standard UART devices are expected to have tolerance for baud rate error by
-4 to +4 %. All Tegra devices till Tegra210 had this support. However,
Tegra186 chip has a known hardware issue. UART Rx baud rate tolerance level
is 0% to +4% in 1-stop config. Otherwise, the received data will have
corruption/invalid framing errors. Parker errata suggests adjusting baud
rate to be higher than the deviations observed in Tx.

Would you please provide the baud rate error tolerance?
It’s very important for our project, Thank you!

Hi,
Have you execute the commands:
Jetson Nano how to use UART on /ttyTHS1 - #2 by gtj

This is required for using ttyTHS1.

Hi, DaneLLL
Thanks for your reply.

The nvgetty service disabled already as mentioned in this post.

We got same issue on ttyTHS1 and ttyTHS2.
You can reproduce this issue by connect two nano module , and set their baudrate with slight difference.

Hi,
Please share how to replicate the issue by connecting two Jetson Nano developer kits. So that we can set up and check.

  1. NanoA’s TX Pin and RX pin short.
  2. Set Baudrate to 9600, 8N1. So one frame contains 10 bits(8d+1s+1e).
  3. Use oscilloscope mesure time t between first startBit fall edge and second startBit fall edge. The real baudrate = 1 / ( t /10)
  4. connect NanoA’s RX Pin to NanoB’s TX pin, and set NanoB’s baudrate from 9600x1.02 to 9600x0.98, NanoB send string “a…z” 26 characters to NanoA.
  5. NanoA Received will error on some baudrate
  6. calculate the tolerance.

Thank you!
5.

For our testcase , NanoA’s real baudrate is 9597, And NanoB set Baudrate from 9300 to 9600 works fine, but set to 9700 cause error.

Hi,
This looks expected. The clock source is not able to generate arbitrary rate and certain values may not work properly. If you use default rate 115200, it should be stable.

Hi, DaneLLL

Did you test the 115200 on two nano modules?
Would you please show the tolerance range at 115200?

Thanks!

Hi,
We have checked it with our team and confirmed there is constraint in Jetson TX1/Nano. The receiver’s baudrate should be higher in the range of 0-X% of the sender’s baudrate.

If Sender (TX) is sending data at 9700 baudrate then RX baudrate should range from 9700 to (9700 * (1 + (X / 100))). This is with the one stop bit configuration.

Please also referto the table:

Bits per character X (in %)
12 2.71
11 2.97
10 3.28
9 3.67
8 4.16
7 4.8

Hi, DaneLLL

Thanks for your help!!

For example, We have an external device connect to nano, set baud rate to 9600.

Now we should set Nano’s baudrate to 9600*1.0328, right?
In this case , How many is Nano 's REAL baud rate for SEND data?

If the SEND baud rate is 9600*1.0328 too, the external receiver maybe fail.

Hi,
Does the external device have tolerance range? Maybe try to set Jetson Nano to 9600* 1.01 or 9600* 1.02. and see if it is within tolerance range of the external device.

THank you!

For regular device, the baud rate tolerance range is +/-2%。
So the max error between sender and receiver is 4%, which is the max accecpted error in uart comm for theory.

The solution seems like this:

Set the baud rate to (REAL value) * 1.02, in order to receive +/-2% input.
Then set dts entry to -200 in order to send REAL baud rate.

It’s crazy to do this trick, But I have no idea for the right way.

Would you please verify this guess?
Thank you!!

Hi,
Since there is known constraint in Jetson Nano, please give it a try with the external device and see if it works.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.