SW activation of UART in J17 connector

Reviewing the datasheets of the Nvidia Jetson TX2, I believe that the only UART connected to a level amplifier to output 3.3V is the one located in the J17 connector. I made some test with a USB to TTL in order to see the output of the TX2 once it boots in a serial monitor on my computer. Nothing happened so looking on the forum, I realized that the UART is by default disabled by software and that NVIDIA launched a patch that can be found here: https://devtalk.nvidia.com/default/topic/1001264/jetson-tx2/tx2-uarts/post/5125115/#5125115

I am somehow new to Linux systems so I do not know exactly how I can use the patch they launched and I am also concerned that if I do it incorrectly I could damage the boot on the TX2 and have to reflash it again as I saw in replies to that post. Could some one help me with a brief description of how one could apply the patch or solve the issue?

I really appreciate your help.

As a general tool against fear of boot issues you may want to set up a serial console. Serial console lets you do things like set alternate boot entries to select at startup…then experiments can be separated from known working configurations. Serial console on the TX2 will be an exact match versus TX1 information, except that you need to use only software/no flow control instead of CTS/RTS (which is hardware flow control…the wires can be connected, just don’t tell the terminal progrma to use it). Some information on serial console:

The file “/boot/extlinux/extlinux.conf” can be explored to see how a boot entry works…there is a general section near the top, then basically a paragraph for each entry. Only one entry works by default. Notice that the boot entry is a series of key/value pairs of plain text. The LABEL is something unique which the boot loader selects. The MENU LABEL is what is displayed to the user when offered a selection. Presumably all LABEL must be unique, and MENU LABEL would be descriptive (or matching) LABEL. The LINUX key/value pair names where the kernel is located. Change this in an alternate boot entry and you have a new kernel to test without touching the original. The APPEND entry is one very long line with arguments presented to the kernel, e.g., the “root=/dev/mmcblk0p1” says to use the first partition (“p1”) of the eMMC ("/dev/mmcblk0") for the file system.

One entry you will see on other Jetsons, but which is not present for TX2 (but easily could be available) is the “FDT” key/value pair. This names the device tree file, and this is what you are interested in editing. Device tree is a selection of settings the kernel needs for booting, but which is considered hardware-dependent in a way that it is undesirable to hard code into the kernel. The U-Boot boot loader can also pass on its version of the device tree which is why there is no need to have the FDT entry in this case. Within the boot entry you could add this and it would be an exact match for the default U-Boot device tree:

FDT /boot/tegra186-quill-p3310-1000-c03-00-base.dtb

…this is because tegra186-quill-p3310-1000-c03-00-base.dtb is what is normally already set up in U-Boot and you’d be replacing the device tree with an exact match.

If you make a copy of the original .dtb file, edit it, and place it back in “/boot” as “modified_tegra186-quill-p3310-1000-c03-00-base.dtb”, then add an entry with this, it’ll use your patched version of the device tree (and this is what the patch is for…add this just below the MENU LABEL line):

FDT /boot/<b>modified_</b>tegra186-quill-p3310-1000-c03-00-base.dtb

One way to get this file is to build the device tree target in a kernel source make. This involves setting up to build the kernel, configuring it, so on. Or you can make simple edits by reverse compiling the existing dtb, editing (it’s plain text), then recompiling. This is quite easy, just install the “dtc” package (short for “device tree compiler”…you can build it with kernel source, or just install as a regular package). Here is info on dtc:

My extlinux.conf entry with the patch has LABEL and MENU LABEL as “ths2” (it’s patched to make “/dev/ttyTHS2” work), and adds that FDT entry. Otherwise it is no change.

You can do this without serial console if you set the DEFAULT to the new LABEL…but then if it fails you won’t be able to boot again until you get your serial console or flash. This particular dtb file change though is fairly low risk. Just read the reverse compiled dts file, find where the patch looks to be intended, edit, recompile, put in place. Note that the file syntax is typically “controller_name@address”. If there is more than one controller, then the address determines which of the matching controllers you are working on. You are looking for the serial controller at address 280000: “serial@c280000”. You want status = “okay”.

1 Like