Disabling the debug service on UART0/ttyS0

I am trying to perform serial communication on my Jetson using its ttyS0 port. Currently I am using the following command each time I boot up to suspend the debug service on the Jetson TX2, allowing proper packet flow:

sudo systemctl stop serial-getty@ttyS0

I was wondering if there is some u-boot rule I can create or some modification to the device tree that I can do in order to stop linux from using this ttyS0 as a debug terminal. I don’t care if I eliminate the service all together, or if I just have it run on another serial port, I just want to stop it from holding ttyS0.

If anyone has done something like this before and could give me some pointers, I would really appreciate it.

Thanks,
Ben

The bootloader would be an entirely different side of the question, but within the Linux side (after the bootloader finishes loading the kernel), you could:

sudo systemctl stop serial-getty@ttyS0
sudo systemctl disable serial-getty@ttyS0

Provided that you don’t have any activity with an external device on the port before the Linux kernel loads this would do the job. If you have activity during the bootloader stages, then I don’t believe there is a simple reversible method to do this.

If you do the above and want to temporarily start the serial service:

sudo systemctl start serial-getty@ttyS0

Or to enable automatic start:

sudo systemctl enable serial-getty@ttyS0

When I put on my USB <-> UART cable connecting my laptop to my Jetson, when the Jetson boots, the debugging service is holding the port, and prevents the rest of the boot. linuxdev, I don’t really care if it’s easily reversible, is there a way to permanently disable or move the service from ttyS0 to a different port? Is there a way to do this, so I do not have to run the command each time I boot up?

You will want to give the current release you are using (see “head -n 1 /etc/nv_tegra_release”) as some of the steps depend on release. I don’t know if there is a way to do this with device tree, someone else will have to step in and say if this is possible, but in the past people have recompiled the bootloader to disable this (not the easiest thing to do, but the bootloader is its own operating system and independent of Linux).

@linux_dev, sorry for the late reply. This was the output of the given command:

# R32 (release), REVISION: 3.1, GCID: 16294929, BOARD: t186ref, EABI: aarch64, DATE: tue Aug 13 04:45:36 UTC 2019

any pointers would be extremely helpful. Thanks!

@linux_dev, sorry for the late reply. This was the output of the given command:

R32 (release), REVISION: 3.1, GCID: 16294929, BOARD: t186ref, EABI: aarch64, DATE: tue Aug 13 04:45:36 UTC 2019

any pointers would be extremely helpful. Thanks!

I’ll rephrase the question for someone knowing more about early boot stages of the R32.3.1 release…

On R32.3.1, to disable serial console and make the ttyS0 available for other use, is there a way to use the device tree to disable this in the bootloader? Or is it mandatory to rebuild the bootloader to disable boot stage serial console? If so, what is the device tree edit?