Jetson TX2 UART clock

Hi guys,

I have try to read almost all posts regarding the TX2 UART configuration and although reading the SoC TRM still without answer.

I simply want to know how they calculated 12.5Mbps in 200MHz clock in all 4 UART (0:3).

The crystal clock is 38.4MHz what is the influence of that clock on the UART performance.

i just want to understand the math… please help me on the matter.

Can you guys specify each UART speed please… and why it is mention that UART1 is not in used although i managed to work with him?

Thanks a lot!!

spend a hole day to understand that issue.

hello efiryw2d,

The UARTs support a device clock of up to 200 MHz. Each symbol requires 16 clock cycles for proper sampling and processing of the input data stream.
Thus, the maximum baud rate is 200/16 = 12.5 Mbps. Because 1 symbol = 1 bit, the data rate is 12.5 Mbps.

please access Jetson Download Center and check these details in [Tegra X2 (Parker Series SoC) Technical Reference Manual]-> [CHAPTER 38: UNIVERSAL ASYNCHRONOUS RECEIVER/TRANSMITTER (UART)]

Already read this section… The problem is that in the L4T RELEASE notes TX2 it is mentioned:
UART0: 115200
UART1: not in use(although I managed to work with 460800)
UART2:921050
UART3:3000000

I am assuming it is the max speed… Why? IT DOESN’T supposed to be 12.5M overall?
It’s related to rhe crystal clock 38.4Mhz?
Can you guys please elaborate… Can I change those speeds with higher speed? If yes can you explain how or send me a clue…after reading
The TRM I am a bit confused.

hello efiryw2d,

I am assuming it is the max speed… Why? IT DOESN’T supposed to be 12.5M overall?
This is not the maximum speed, but here mentioned speed are just the tested rates on internal TX1 platform.
Maximum speed for all instances is 12.5M

Can you guys please elaborate… Can I change those speeds with higher speed? If yes can you explain how or send me a clue…after reading The TRM I am a bit confused.
yes, you can test with higher speeds.
But with Linux kernel, there are only below speed macros present.

$TOP/kernel/kernel-4.4/include/uapi/asm-generic/termbits.h

#define    B57600 0010001
#define   B115200 0010002
#define   B230400 0010003
#define   B460800 0010004
#define   B500000 0010005
#define   B576000 0010006
#define   B921600 0010007
#define  B1000000 0010010
#define  B1152000 0010011
#define  B1500000 0010012
#define  B2000000 0010013
#define  B2500000 0010014
#define  B3000000 0010015
#define  B3500000 0010016
#define  B4000000 0010017

So you can test up to maximum of 4Mbps.

Thanks… 4Mbps per 1 UART? Or overall we have 4 UARTS… 0-3

  1. Do you have a document or a clue on how do
    I changed the speed…?
  2. According to the L4T feature list those are
    the speeds on each UART:
    UART0: 115200
    UART1: not in use(although I managed to work with 460800 max)
    UART2:921050
    UART3:3000000. Overall 4.5Mbps

In your explenation can you relate to those speeds and explain the logic behind them.

hello efiryw2d,

please refer to below,

  1. you can specify the baud rate by using stty command:
# sudo stty -F /dev/ttyTHS1 3000000
  1. please note that these UART speeds are tested with below devices on internal platforms.
    Please ignore the speed mentioned, all UART instances can be tested at higher speeds.
    UART0: 115200 → Debug UART
    UART1: not in use
    UART2: 921050 → GPS application
    UART3: 3000000. Overall 4.5Mbps → Bluetooth Application.

Hello,
I’m sorry but I’m not sure that I understand.

These are my questions:

  1. I couldn't find any example on the 12.5 Mbits speed. Are there any NVIDIA examples or tests which actually exhibit that this speed can be achieved?
  2. Is maximum speed 12.5Mbits is for all UARTs together? Or is it for each one of them separately and I can set all of them with this baud rate simultaneously?
  3. Regarding to stty command mentioned above: Is it related to each UART separately? Or is it an overall Jetson setup command which impact on all UARTs? If I'm using POSIX APIs or Boost C++ APIs to set all UART options including the baud rate, Am I still need to activate this command also?

hello orong13,

please refer to below,

1. I couldn’t find any example on the 12.5 Mbits speed. Are there any NVIDIA examples or tests which actually exhibit that this speed can be achieved?
Linux kernel has restriction on speed, Maximum speed macro (B4000000) present is 4Mbps.
So we can test up to maximum of 4Mbps with Linux Kernel.

2. Is maximum speed 12.5Mbits is for all UARTs together? Or is it for each one of them separately and I can set all of them with this baud rate simultaneously?
Maximum speed 12.5Mbps is applicable for UART controller separately.
You can set this speed simultaneously on all UART separately.

3.1 Is it related to each UART separately? Or is it an overall Jetson setup command which impact on all UARTs?
This is for each UART separately and applies to the mentioned device node (Ex: /dev/ttyTHS1)

3.2 If I’m using POSIX APIs or Boost C++ APIs to set all UART options including the baud rate, Am I still need to activate this command also?
It’s not required to activate above command when your are setting with APIs.

Thanks JerryChang,
Everything is understood,

One last question in order to verify that I understand:
The 12.5Mbits is supported by the UART HW but due to the fact that the OS is Linux (L4T) there is a SW restriction to 4Mbits.

Am I right?

If I’m right, suppose i will work with a different OS or any kind of upgraded Linux, will I be able to successfully use a higher baud rate?

Regard,

The Linux kernel is what restricts to 4Mb/s (which seems simply to be that some arbitrary value was set and there isn’t any other particular reason…serial UARTs have been around a very long time, and I would guess that at the time no UART was made which could reach higher speeds). Hardware supports 12.5Mb/s. In theory the kernel could be modified at “include/uapi/asm-generic/termbits.h”, recompiled and reinstalled, and might work to 12.5Mb/s…just make sure that it is a value achievable by a valid divisor since this uses a clock multiplier and not all speeds can be reached (the divisor is a power of two or some variation…see the TRM for divisors).

In terms of practical application you will find a need to use two stop bits most of the time above 115200.