Use UART3 as Serial UART in Jetson TX2

We are working with Jetson TX2 in L4T 32.2.1. We would like to use the UART3 (Pins H9, H10) as serial debug. We referred the below link and changed the dtb as well as Linux for Tegra package. Below are the changes that we made.

in hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi

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

           +/*compatible = "nvidia,tegra20-uart", "nvidia,tegra186-hsuart";
            console-port;
            sqa-automation-port;
            /delete-property/ resets;
            /delete-property/ reset-names;
           -status = "okay";
           +status = "okay";*/
    };

    serial@3130000 {
           -compatible = "nvidia,tegra186-hsuart";
           -dma-names = "tx";
           +compatible = "nvidia,tegra20-uart", "nvidia,tegra186-hsuart";
           +console-port;
           +/delete-property/ resets;
           +/delete-property/ reset-names;
            status = "okay";

           +/*compatible = "nvidia,tegra186-hsuart";
           +dma-names = "tx";
           +status = "okay";*/
    };

in bootloader/t186ref/BCT/tegra186-mb1-bct-misc-si-l4t.cfg

##### debug variables #####
debug.enable_log = 1;
-debug.uart_instance = 0;
+debug.uart_instance = 3;
##### sw_carveout variables #####

in p2771-0000.conf.common

ROOTFSSIZE=28GiB;
-CMDLINE_ADD="console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0";
+CMDLINE_ADD="console=ttyS3,115200n8 console=tty0 fbcon=map:0 net.ifnames=0";
target_board="t186ref";

Strangely, we are getting the below error when executing the flash command.

[  66.7223 ] tegrarcm_v2 --isapplet
[  67.3619 ] 
[  67.3651 ] tegradevflash_v2 --iscpubl
[  67.3681 ] CPU Bootloader is not running on device.
[  67.6858 ] 
[  68.6894 ] tegrarcm_v2 --isapplet
[  69.3259 ] 
[  69.3279 ] tegradevflash_v2 --iscpubl
[  69.3294 ] CPU Bootloader is not running on device.
[  69.6459 ] 
Error: None of the bootloaders are running on device. Check the UART log.
Failed flashing t186ref.

Are there any steps to resolve this issue.

hello ashlinsurey.a,

those device tree and board configuration update looks fine, it looks like board detection issue for flashing.
may I know what’s your flash commands, please have a try to perform a complete flash since you’re having board configuration updates,
thanks

Hi Jerry,

I downloaded the L4T_32.2.1 package and sample rootfs from the download center, made the above-mentioned changes in the three files and tried flashing using the below command.

sudo ./flash.sh jetson-tx2 mmcblk0p1

Interestingly, When I tried to debug the issue, I reverted the changes in the tegra186-mb1-bct-misc-si-l4t.cfg file and tried flashing. The flash process succeeded.

It looks like the change made in the tegra186-mb1-bct-misc-si-l4t.cfg file alone, has something to do with this.

Hi Jerry,

Adding to the above query, We tried the same implementation in L4T 32.4.3 and L4T 28.2.1.

In L4T 32.4.3, we observe a similar behaviour where the flash gets stuck at “tegrarcm_v2 --isapplet”.

In L4T 28.2.1, we didn’t face any issues in the flash process. And after adding the below lines in the device tree, we are able to get the console prints in the UART3.

	/* for UART-3 */
	gpio@2200000 {
		wifi_over_pcie {
			status = "okay";
		};
	};

Is there a way to solve this in the newer L4T versions?

hello ashlinsurey.a,

please access TX2 Product Design Guide via download center, you may also check [Table 75. UART Interface Mapping].
this should be available if not used for on-module WLAN/ BT.
thanks

Hi Jerry,

Thanks for the document. We have referred it and made the relevant changes in the device tree.

Is there a way to fix the flashing issue we are experiencing in the L4T 32.2.1?

hello ashlinsurey.a,

may I know what’s your use-case to enable the use of UART-3.
could you please configure enable_log to 0 then flashing the board.
thanks

##### debug variables #####
debug.enable_log = 0;

Hi Jerry,

We tried to flash the device after setting enable_log=0. We were able to flash the device but we didn’t get any output in the serial console. On checking the kernel parameters, the console is set as none (console=none). Is there a workaround for this ?

hello ashlinsurey.a,

currently, for TX2, flashing process stuck if we change debug uart from 0 to anything else,
please configure enable_log = 0; if you don’t care about bootloader logs, thanks