Jetson Nano - Disable Serial Console to use all 3 UARTS

Hello everyone,
I am happy to use the Jetson Nano since 2 months. I am not very experienced with Jetson boards. But I need 3 UART Ports accessible to communicate with other things. I read that the Jetson Nano has 3 UART Ports. At the moment I use the Jetson development board but the module will be swapped out of the Jetson Nano in our own board (if it is relevant). The problem is, that on Serial 0 is a serial console. I don’t want this console. Am I able to use all 3 of those UARTs in user land using syscalls or c++/python code.

Can you please give me full instructions to do that or hint me to a tutorial or something like that?

If I won’t get 3 Serial ports, I am technically able to use unused SPI Ports as UARTs if I just won’t connect the clock. Do you think I am able to do this? But this would be the last try.

Thank you in advance,
Fabio Manz

No, that won’t work at all.

You can get as many UARTs as you want if you slave some small microcontroller with additional UARTs on your board – a $1 Cortex M0 with a little bit of firmware could do it. You could then let that MCU talk to each UART, and use one of the Nano UARTs (or SPI or I2C) to talk to the MCU.
Compared to the cost of a custom carrier PCB, the additional MCU is unlikely to be a big cost (unless you plan on making hundreds of thousands of these.)

OK. Thank you for that idea. But how many UARTs am I able to use?

Hi,
There are information in the following topic:
https://devtalk.nvidia.com/default/topic/1068297/jetson-tx2/enable-uart3-ths3-on-r32/post/5411454/#5411454
Please pay a visit.

Hi, thanks for the answer. I don’t know if it’s important, but I am talking about the Jetson Nano but the post is about the TX2. I read in the data sheet, that the Jetson Nano only has 3 UARTs on its connector. That wouldn’t correspond to your link. It’s page 34-35 in the Jetson Nano module data sheet. Can I use all of them for my own purposes or can I even use 2 of those?

Hi,

Yes, Nano CVM has 3 UART coming out.
UART2 for debug. Only TX and RX available
UART0 on the M2 Key
UART1 @ 40 pin connector

To use UART2 for no debug usecase, just remove console-port from the Kernel DTS

diff --git a/kernel-dts/tegra210-porg-p3448-common.dtsi b/kernel-dts/tegra210-porg-p3448-common.dtsi
index a73561e…98fc8ce 100644
— a/kernel-dts/tegra210-porg-p3448-common.dtsi
+++ b/kernel-dts/tegra210-porg-p3448-common.dtsi
@@ -683,7 +683,6 @@

    serial@70006000 { /* UART-A : UART1: Debug */
            compatible = "nvidia,tegra210-uart", "nvidia,tegra114-hsuart", "nvidia,tegra20-uart";
  •           console-port;
              sqa-automation-port;
              /delete-property/ resets;
              /delete-property/ reset-names;

Hi,

I tried to change what you said, but I still got a serial console. Can you give me a hint what I’m doing wrong?

Firstly I used this repo a lot: https://github.com/JetsonHacksNano/buildKernelAndModules
I ran the getKernelSources.sh script. Then I removed this line " console-port;" in the file: /usr/src/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-porg-p3448-commen.dtsi .
Then I ran makeKernel.sh and makeModules.sh.
Lastely I made this:

$ cp /boot/Image $INSTALL_DIR/Image.orig
$ ./copyImage.sh

I made a loopback test, by connecting RX to TX and both via a 5kOhm resistor to GND, but didn’t get my message back out. Also I am wondering what linux device I should use. Is it /dev/ttyTHS2?
Then I connected a second PC to the MicroUSB Port and got a serial console. Is this ok?

What am I doing wrong and by the way can I use UART0 for my own purposes if I don’t use the m.2 slot?

I tried to change what you said, but I still got a serial console. Can you give me a hint what I’m doing wrong?

Not sure if you noticed this… what you are modifying is the dts/dtsi file (device tree) but what you’ve rebuilt through the script is the kernel image. They are two different files. You were just keeping updating kernel image but not dtb.

Please read our l4t document to understand how to build dtb.

It may be better to use use USB-UART converteter for use 3 or 4 UART device?

So after a few days of headaches, I’m actually in the same spot as before.

  • Serial console on ttyS0 will not go away
  • I may not access ttyS0 for my own purposes as its group is tty and changes to that won't last (user changed from nvidia to root tho, see below)
  • Kernel bootlog outputs to ttyS0

What I’ve done so far:
In general, I followed this guidehttps://developer.ridgerun.com/wiki/index.php?title=Jetson_Nano/Development/Building_the_Kernel_from_Source#Flash_DTB_from_the_Jetson_device_itself on building the sources, as I’ve found the nvidia docs to be rather sparse and difficult to follow.

After successfully compiling, I tried flashing DTB only as well as flashing the whole filesystem with flash.sh

Other things I noticed:

  • ``` /proc/cmdline ``` is still supplied with console=ttyS0
  • Editing ``` cbootargs ``` in u-boot console to fix that by hand will brick the system (doesn't boot anymore)
  • The only noticeable change was the owning user of ttyS0 when running ``` ls -la /dev/ttyS* ``` from "nvidia" to "root"

Any further hints would be much appreciated as I’m very eager to make this work.

Hi,
I just have the same problem as mentioned above. I’m trying to use ttyS0 serial for other than serial console purpose.

I deleted line in p3448-0000.conf.common according to NVIDIA Tegra Linux Driver Package Development Guide

// CMDLINE_ADD=“console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0”; //DELETE LINE

and deleted lines in tegra210-porg-p3448-common.dtsi as suggested above :

//console-port; // DELETE LINE

  chosen {
	nvidia,tegra-porg-sku;
	stdout-path = "/serial@70006000";      ///DELETE LINE 
	nvidia,tegra-always-on-personality;
	no-tnid-sn;
	bootargs = "kmemleak=on earlycon=uart8250,mmio32,0x70006000";   ///DELETE LINE 

But after changing this and updating kernel/dtb, serial console is still on this port and I can see boot logs on startup.

What I tried next was configuring serial port in tegra210-porg-p3448-common.dtsi according to serial2:

serial@70006000 { /* UART-A : UART1: Debug */
compatible = “nvidia,tegra114-hsuart”;
status = “okay”;
};

After changing this, serial console is gone, but I can’t open ttyS0 port in terminal
(after sudo sh -c ‘cat < /dev/ttyS0’ command the result is: cat: -: Input/output error. )

How should I proceed ?
Thanks

Regards
Tom

Hi Tom.

Please open a new topic for your issue. Thanks

Could you please explain this in detail.
.diff is the comparison between 2 files
.git is for git

How we can remove console-port?

Hello, could the compiling .dts be done in dependently to rebuiliding the kernel? Will just compile and replace the old one in /boot/dtb/ work?
Thanks.