Can I use the UART3 as the debug port on TX2, R28.1?

Hi, all

I want to use UART3(serial@3130000) as the debug port.

According to the below method, I modified my configs, but it does not work.

https://devtalk.nvidia.com/default/topic/1025894/jetson-tx2/uart1-acts-as-default-debug-port-on-tx2-r28-1/post/5220368/#5220368

Hello Tonie,
It looks like you are trying to get console logs on UART2, please make below changes to get console logs on uart2:

1. To get mb1/bootloader message:
BCT changes:
file name: tegra186-mb1-bct-misc-si-l4t.cfg
****************************
cpu.nafll_b_cluster_data = 0x11F04461;
##### debug variables #####
debug.enable_log = 1;
-debug.uart_instance = 0;
+debug.uart_instance = 2;
##### sw_carveout variables #####
****************************

2. To get kernel logs:
dts changes:
serial@3100000 {
- compatible = "nvidia,tegra20-uart", "nvidia,tegra186-hsuart";
+ compatible = "nvidia,tegra186-hsuart";
console-port;
sqa-automation-port;
status = "okay";
@@ -53,7 +53,7 @@
};

serial@c280000 {
- compatible = "nvidia,tegra186-hsuart";
+ compatible = "nvidia,tegra20-uart", "nvidia,tegra186-hsuart";
status = "okay";
};

3. Add ttyS2 in kernel-command line:

-CMDLINE_ADD="console=ttyS0,115200n8 console=tty1 OS=l4t fbcon=map:0 net.ifnames=0";
+CMDLINE_ADD="console=ttyS2,115200n8 console=tty1 OS=l4t fbcon=map:0 net.ifnames=0";

4. Connect Serial port to UART2 to get console logs.

Under R28.1 many of those changes are simpler than with requirements for flash tools on later releases. Did you check the final device tree to see if your changes actually made it into the tree? E.g., extract from a running system:

dtc -I fs -O dts -o extracted.dts /proc/device-tree

Bootloader though is still separate from after the time the Linux kernel takes over. Failure during bootloader stage will be different than failure during Linux kernel stage. Is it failing in both cases?

Btw, the CTS/RTS flow control does not work correctly in the TX2 serial console. Is your serial console program trying to use CTS/RTS? Which program are you using for your console? It should run at 115200 8N1.

Hi, linuxdev,
Thanks for your reply.

The failure looks like in linux kernel stage.

[ 24.223169] ---[ end trace a76c7021980d6b16 ]---
[ 24.228574] Call trace:
[ 24.231771] [<ffffffc00013ca74>] watchdog_timer_fn+0x230/0x33c
[ 24.238364] [<ffffffc0001073c4>] __hrtimer_run_queues+0x140/0x350
[ 24.245212] [<ffffffc000107e24>] hrtimer_interrupt+0x9c/0x1e0
[ 24.251739] [<ffffffc000930e38>] tegra186_timer_isr+0x24/0x30
[ 24.258238] [<ffffffc0000f4cb0>] handle_irq_event_percpu+0x84/0x290
[ 24.265234] [<ffffffc0000f4f00>] handle_irq_event+0x44/0x74
[ 24.271568] [<ffffffc0000f8208>] handle_fasteoi_irq+0xb4/0x188
[ 24.278124] [<ffffffc0000f42d0>] generic_handle_irq+0x24/0x38
[ 24.284588] [<ffffffc0000f45d8>] __handle_domain_irq+0x60/0xb4
[ 24.291153] [<ffffffc0000815dc>] gic_handle_irq+0x5c/0xb4
[ 24.297280] [<ffffffc000084740>] el1_irq+0x80/0xf8
[ 24.302796] [<ffffffc0000e7a3c>] default_idle_call+0x1c/0x2c
[ 24.309195] [<ffffffc0000e7c58>] cpu_startup_entry+0x1bc/0x340
[ 24.315769] [<ffffffc000bb3108>] rest_init+0x84/0x8c
[ 24.321492] [<ffffffc0011a097c>] start_kernel+0x39c/0x3b0
[ 24.327668] [<0000000080bb9000>] 0x80bb9000

After flash DTB file, I found the “debug.uart_instance = 3” become “debug.uart_instance = 0”. The tegra186-mb1-bct-misc-si-l4t.cfg file seems to be overwritten.

1. To get mb1/bootloader message:
BCT changes:
file name: tegra186-mb1-bct-misc-si-l4t.cfg
****************************
cpu.nafll_b_cluster_data = 0x11F04461;
##### debug variables #####
debug.enable_log = 1;
-debug.uart_instance = 0;
+debug.uart_instance = 3;
##### sw_carveout variables #####
****************************

That failure is in the watchdog timer. By default this shouldn’t be running and isn’t actually part of serial console itself (it is likely that something other than serial console is going wrong). If you are experimenting with watchdog timer, then you should probably remove any watchdog timer edits or modifications until done working on the UART.

The method for updating device tree varies depending on release. Which release are you using (see “head -n 1 /etc/nv_tegra_release”)?