Disable the default console serial port (ttyS0)

We are trying to disable the default console serial port for debug (ttyS0). As we are using the port for something else, we would like to disable any signal going out on this port (boot included).

Configuration:

  • Jetson TX1 dev board
  • TX1Jetpack versions 3.0 and 3.1 (both versions)
  • reading serial data out of the serial port ttyS0 on pin 9 of J21.

Current status:

  • ttS0 serial port is sending data when the TX1 boots and during transmissions which causes errors in our communication protocol.
  • extlinux.conf file attached for reference (directory /boot/extlinux). Does not contain any reference to the console tty or ttyS0.
  • ttyS0.conf file attached for reference (directory /etc/init)

Solutions already tried:

None of those solutions was able to disable (or even reduce) the port output data.
Does someone as a method to do that which is working for both JetPack versions ?

I think you will find the cbootargs in U-Boot now contains much of the environment (command line) passed to the Linux kernel, and not just the APPEND key/value pair from extlinux.conf. cbootargs itself is set up from the device tree. I don’t know off hand which file corresponds to the cbootargs section, but you can see the sum total of all boot argument effects after boot via:

cat /proc/cmdline

If you go into U-Boot command line via serial console you can:

echo $cbootargs

Here is some device tree information for R28.1 (a TX2 and TX1 are basically the same instructions, but a different name is used for the DTB partition depending on TX1 or TX2):
https://elinux.org/Jetson/TX2_DTB

Thanks linuxdev. I managed to disable serial console on UART0/ttyS0 in the kernel and U-boot.

However, I see that cboot and perhaps another step before that still has boot spew. Do you know how to disable it? Also I cannot find the cboot source code either.

This was just posted and would be relevant:
[url]https://devtalk.nvidia.com/default/topic/1025894/jetson-tx2/uart1-acts-as-default-debug-port-on-tx2-r28-1/post/5220368/#5220368[/url]

That URL is about changing serial console from the standard ttyS0 to ttyS2, but if you do only the part which disables ttyS0, and do not add the part which enables ttyS2, then it should disable serial console.

I seem to be having the same problem with the J21 UART on the TX2. I’m connecting to a serial device (a pixhawk variant autopilot running ardupilot/mavlink) via /dev/ttyS0. I can only intermittently achieve a good connection. Often I just get lots of garbage packets.

I also have noticed that if my serial connection is active prior to booting the TX2, then the TX2 won’t boot.

From this thread and other similar ones, I surmise the problem could be that ttyS0 is being used for the debugging console. So when I try to make my connection on ttyS0, maybe I’m getting interference with the console output?

In my /proc/cmdline on the TX2, I do see the line “console=ttyS0,115200n8”. I guess I need to somehow remove this from the dtb. Is there an easy way to do that?? I don’t want to mess anything else up.

“ttyS0” (J21) is, as you suspected, already in use. The garbage is the console text (part from the system normal boot output, part from whatever response there is to the data the pixhawk is feeding to the login shell). If the serial console sees input during U-Boot, then U-Boot drops into a shell for the user to do “U-Boot things” (e.g., pick a kernel to boot, poke around in macros, so on). Dropping into a U-Boot shell will stop boot until the “boot” command is issued.

Removing the function of serial console once in Linux is easy. Removing the function of the serial console in U-Boot is not easy. Having no serial console is in general a bad idea. Moving to J17 (ttyTHS2) is easy since nothing is using it (unless you put a custom camera on the camera port which uses the serial port nothing will touch J17). Is there any reason you can’t use J17?

Note that some of the serial console settings during U-Boot are actually compiled in features. Parts of the dtb have an effect on early boot stages, but so far as I know removing serial console from U-Boot would require an actual rebuild of U-Boot with changed options, and then reinstall of the custom U-Boot.

Unfortunately I don’t have J17 exposed on my carrier board.

Do you happen to know a reference for changing/rebuilding/reinstalling U-Boot on the TX2?

Some steps may depend on which release you are using, especially the steps on how to install a new device tree. However, what follows should be close so far as the topic goes for changing to an alternate serial console. Keep in mind that if you leave out the steps for creating a new serial console, then you are simply removing serial console. This is a bad idea if it can be avoided since the only possibility after that to know what went wrong is to flash the system again with new parameters and see if it works. Start here:
https://devtalk.nvidia.com/default/topic/1025894/jetson-tx2/uart1-acts-as-default-debug-port-on-tx2-r28-1/post/5220368/#5220368

As for U-Boot itself, go to the official page of your release (see “head -n 1 /etc/nv_tegra_release” if you don’t know), and get the “Documentation” download. Within that is a bootloader customization section. L4T version listings are shown here:
https://developer.nvidia.com/embedded/linux-tegra-archive

The “source_sync.sh” script can be used to download the correct bootloader source. This is for U-Boot for version R28.1:

./source_sync.sh -u tegra-l4t-r28.1

You’ll have to dig around for the serial console options to figure out what part is in need of change. In some releases the device tree change may be enough, but not in other cases.