Communication on serial port fails after a while on xavier nx

Hi,
I am trying to communicate through uart2 on xavier nx. This port is by default used for debug console and tegra-combined-uart. Making some changes in conf.common , common.dtsi files and disabling CONFIG_SERIAL_8250_CONSOLE support in kernel config file, I managed to turn off ttyTCU port and instead of it ttyTHS2 appears.

tty_s

Now I can open ttyTHS2 in terminal and read/write operations are ok. But after a few seconds data stops to comming out of the port. I write simple c++ program in which I am sending message “MESSAGE” in a while loop.

As you can see in below screenshot from logic analyzer, messages stops to coming out of the port after approx 12 seconds.

The strange thing I have noticed, is that after restart of program, all the previous messages which not came out are suddenly transmitted with the first message. (screenshot below).

So it seems like those messages are stucks somewhere in the buffer and don’t came out.

Does anybody have any tips what can cause this behavior ?

Thanks in advance for any relevant reply.

Regards,
Tom

There isn’t enough to say why, but if you run “dmesg --follow” to monitor logs, what shows up when the error hits? You could just leave that command running, and then when the problem occurs, find out if some new relevant log is showing up.

hello tomfreakk,

may I know which JetPack release you’re working with?
please share the modification you’d done for the configuration files.
you may also gather kernel logs (i.e.$ dmesg --follow) for reference,
thanks

Hi,
I am working with JetPack 4.4. I tried “dmesg --follow” but unfortunately there are no new logs in dmesg after executing a program.

Maybe it’s not important but I forgot to mention above that write() function in test code returns always “7” (even after messages stops coming out of the port) which is correct length of written message (“MESSAGE”).

Changes made in config files and device tree :

File: …Linux_for_Tegra/p3668.conf.common

--  CMDLINE_ADD="console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0";
++  CMDLINE_ADD="console=tty0 fbcon=map:0 net.ifnames=0";

File: sources/hardware/nvidia/platform/t19x/porg/kernel-dts//tegra194-p3668-common.dtsi

	chosen {
--		//bootargs ="console=ttyTCU0,115200";
		board-has-eeprom;
		nvidia,tegra-joint_xpu_rail;
	};

...

	combined-uart {
--		console-port;
--		combined-uart;
--		status = "okay";
++              /delete-property/reg;
	};
  • Changes in tegra-combined-uart.c driver:(this function content commented out)
static int __init tegra_combined_uart_console_setup(struct console *co,
							char *options)
{
	/*int baud = 115200;
	int parity = 'n';
	int bits = 8;
	int flow = 'n';

	if (options)
		uart_parse_options(options, &baud, &parity, &bits, &flow);

	return uart_set_options(&tegra_combined_uart_port, co, baud, parity,
				bits, flow);*/
	return 0;
}
  • Changes in kernel config file while kernel compiling:
-- CONFIG_SERIAL_8250_CONSOLE=y
-- CONFIG_MAGIC_SYSRQ=y
++ # CONFIG_SERIAL_8250_CONSOLE is not set
++ # CONFIG_MAGIC_SYSRQ is not set

hello tomfreakk,

may I know your physical pin connections, which pin you’re used for serial port communication.
thanks

Hi, I am using uart2 (debug) on module pins 236/238, whose address is serial@c280000 in system.

hello tomfreakk, this issue has been solved?