Jetson xavier NX doesn't get detected in device mode after bootup unless unplug and plug it back

I am new to this. Is it memory mapped address? Which register it is? How to dump the register value, can you let me know how to do it? Any sysfs interface we have to get the value?

busybox devmem 0x3520360

I’ll try it out and let you know.

One interesting thing to share with you. Yesterday I was trying few things w.r.t device mode and randomly found interesting thing.

  1. I had connected the USB mouse to the USB2-1 node (Type-A female connector) which is in host mode and as usual USB2-2 node(Type-c connector) connected to host. After boot-up, I could see at host machine(ubuntu) Jetson xavier is detected in device mode.

When did the dmesg at Jetson xavier nx side. I see additional thing trigging which informs host connect, which was not happening earlier.

Earlier dmesg log I have shared, you can notice its goes into disabled state and further nothing. Below is the log snippet

l4tbr0: port 1(rndis0) entered blocking state
[ 13.933954] l4tbr0: port 1(rndis0) entered disabled state
[ 13.934181] device rndis0 entered promiscuous mode
[ 13.989237] l4tbr0: port 2(usb0) entered blocking state
[ 13.989263] l4tbr0: port 2(usb0) entered disabled state
[ 13.989773] device usb0 entered promiscuous mode

In current scenario its changes state from disabled to forwarding state so host can detect it. Below is the log snippet

[ 1507.166961] tegra-xudc 3550000.xudc: EP 5 (type: intr, dir: in) enabled
[ 1507.167007] tegra-xudc 3550000.xudc: EP 3 (type: bulk, dir: in) enabled
[ 1507.167036] tegra-xudc 3550000.xudc: EP 2 (type: bulk, dir: out) enabled
[ 1507.167350] tegra-xudc 3550000.xudc: EP 9 (type: intr, dir: in) enabled
[ 1507.167413] tegra-xudc 3550000.xudc: EP 7 (type: bulk, dir: in) enabled
[ 1507.167435] tegra-xudc 3550000.xudc: EP 4 (type: bulk, dir: out) enabled
[ 1507.167832] tegra-xudc 3550000.xudc: EP 15 (type: intr, dir: in) enabled
[ 1507.168185] IPv6: ADDRCONF(NETDEV_CHANGE): rndis0: link becomes ready
[ 1507.169201] tegra-xudc 3550000.xudc: EP 11 (type: bulk, dir: in) enabled
[ 1507.169237] tegra-xudc 3550000.xudc: EP 6 (type: bulk, dir: out) enabled
[ 1507.169991] l4tbr0: port 1(rndis0) entered blocking state
[ 1507.170062] l4tbr0: port 1(rndis0) entered forwarding state
[ 1507.177952] IPv6: ADDRCONF(NETDEV_CHANGE): l4tbr0: link becomes ready
[ 1507.178988] tegra-xudc 3550000.xudc: EP 13 (type: bulk, dir: in) enabled
[ 1507.179026] tegra-xudc 3550000.xudc: EP 8 (type: bulk, dir: out) enabled
[ 1507.180625] tegra-xudc 3550000.xudc: ep 13 disabled
[ 1507.180803] tegra-xudc 3550000.xudc: ep 8 disabled
[ 1507.200135] tegra-xudc 3550000.xudc: EP 13 (type: bulk, dir: in) enabled
[ 1507.200177] tegra-xudc 3550000.xudc: EP 8 (type: bulk, dir: out) enabled
[ 1507.200884] IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready
[ 1507.201605] l4tbr0: port 2(usb0) entered blocking state
[ 1507.201615] l4tbr0: port 2(usb0) entered forwarding state

  1. Second experiment I did is bootup without usb mouse, just Jestson xavier nx connected to host machine with usb cable. After bootup host doesn’t detect Jetson xavier nx in device mode. At jetson side log says
    “l4tbr0: port 1(rndis0) entered disabled state”
    “l4tbr0: port 2(usb0) entered disabled state”
    After I insert the usb mouse to USB2-1 port, host machine detects the Jetson xavier nx in device mode. Refer the log, here state changes from disabled to forwarding and later usb mouse get registered.
    dmesg_log_20072023.txt (76.9 KB)

nx@dhcp-10-164-9-21:~$ sudo dmesg -c
[ 1506.784457] tegra-xusb 3610000.xhci: Firmware timestamp: 2022-03-16 11:07:43 UTC, Version: 60.13 release
[ 1507.148049] usb 1-2: new low-speed USB device number 2 using tegra-xusb
[ 1507.166961] tegra-xudc 3550000.xudc: EP 5 (type: intr, dir: in) enabled
[ 1507.167007] tegra-xudc 3550000.xudc: EP 3 (type: bulk, dir: in) enabled
[ 1507.167036] tegra-xudc 3550000.xudc: EP 2 (type: bulk, dir: out) enabled
[ 1507.167350] tegra-xudc 3550000.xudc: EP 9 (type: intr, dir: in) enabled
[ 1507.167413] tegra-xudc 3550000.xudc: EP 7 (type: bulk, dir: in) enabled
[ 1507.167435] tegra-xudc 3550000.xudc: EP 4 (type: bulk, dir: out) enabled
[ 1507.167832] tegra-xudc 3550000.xudc: EP 15 (type: intr, dir: in) enabled
[ 1507.168185] IPv6: ADDRCONF(NETDEV_CHANGE): rndis0: link becomes ready
[ 1507.169201] tegra-xudc 3550000.xudc: EP 11 (type: bulk, dir: in) enabled
[ 1507.169237] tegra-xudc 3550000.xudc: EP 6 (type: bulk, dir: out) enabled
[ 1507.169991] l4tbr0: port 1(rndis0) entered blocking state
[ 1507.170062] l4tbr0: port 1(rndis0) entered forwarding state
[ 1507.177952] IPv6: ADDRCONF(NETDEV_CHANGE): l4tbr0: link becomes ready
[ 1507.178988] tegra-xudc 3550000.xudc: EP 13 (type: bulk, dir: in) enabled
[ 1507.179026] tegra-xudc 3550000.xudc: EP 8 (type: bulk, dir: out) enabled
[ 1507.180625] tegra-xudc 3550000.xudc: ep 13 disabled
[ 1507.180803] tegra-xudc 3550000.xudc: ep 8 disabled
[ 1507.200135] tegra-xudc 3550000.xudc: EP 13 (type: bulk, dir: in) enabled
[ 1507.200177] tegra-xudc 3550000.xudc: EP 8 (type: bulk, dir: out) enabled
[ 1507.200884] IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready
[ 1507.201605] l4tbr0: port 2(usb0) entered blocking state
[ 1507.201615] l4tbr0: port 2(usb0) entered forwarding state
[ 1507.302590] usb 1-2: New USB device found, idVendor=413c, idProduct=301a, bcdDevice= 1.00
[ 1507.302645] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1507.302658] usb 1-2: Product: Dell MS116 USB Optical Mouse
[ 1507.302668] usb 1-2: Manufacturer: PixArt
[ 1507.312505] input: PixArt Dell MS116 USB Optical Mouse as /devices/platform/3610000.xhci/usb1/1-2/1-2:1.0/0003:413C:301A.0001/input/input5
[ 1507.312935] hid-generic 0003:413C:301A.0001: input,hidraw0: USB HID v1.11 Mouse [PixArt Dell MS116 USB Optical Mouse] on usb-3610000.xhci-2/input0

Hi,

As that observation, I think the device tree you are using now does not match to the hardware design you are using.
Please refer to the developer guide t o confirm your device tree change is correct.

Hi WayneWWW,

I checked the device tee and hardware design both matches. Please find the attached DTSI (Refer the USB part) and schematic for reference.
tegra194-p3668-common.dtsi (17.7 KB)
USB


Jestson SOM GPIO for USB

JETSON SOM USB connections

Please let me know anything mismatch between schematics and DTSI.

With Regards,
Ashwath B N

Hi,

I tried to read your schematic but the resolution seems not right so I cannot see any of the text on it clearly.

Please share it again.

Also, before I read your dts, could you clarify what did you change in it in comparison with original file?

I was ooo due to sick. I am attaching the new snapshot with high resolution, but it is getting reduced while uploading.
USB - There are 3 connectors a) Micro-usb slot b) Type-c connector c) USB2.0 connector.


Jestson SOM GPIO for USB

JETSON SOM USB connections

Moved the Device mode from Micro-usb connector port(node USB2-0) to Type-c connector port(node USB2-2). If you want the original file without any modification, I can find out and send you.

Moved the Device mode from Micro-usb connector port(node USB2-0) to Type-c connector port(node USB2-2). If you want the original file without any modification, I can find out and send you.

could you share that as a patch file instead of a whole file…?

Hi WayneWWW,

Please find the attached patch file.
PatchFile (6.9 KB)

with Regards,
Ashwath BN

dmesg is needed too.

I also read your patch, there are some codes added and removed but they are not from our code base at all.

So did you add them in the end or not? I mean this part

-    gpio@2200000 {
-            USB3_FLIP {
-                    gpio-hog;
-                    output-high;
-                    gpios = <TYPEC_FLIP GPIO_ACTIVE_HIGH>;
-                    label = "usb_flip-enable";
-                    status = "okay";
-            };
-    };
-        /*ONSEMI : Added entry for I2C controlled HW (CSI)*/
-        i2c8: i2c@31e0000 {
-                /*ONSEMI : Added FUSB302 entry*/
-                fusb302: typec-portc@22 {
-                      compatible = "fcs,fusb302";
-                      reg = <0x22>;
-                      fcs,int_n = <&tegra_aon_gpio TEGRA194_AON_GPIO(CC, 0) GPIO_ACTIVE_LOW>;
-                      mux-gpios = <&tegra_main_gpio TYPEC_FLIP GPIO_ACTIVE_HIGH>;
-
-                      usb_con: connector {
-                          compatible = "usb-c-connector";
-                          label = "USB-C";
-                          vbus-supply = <&usb2_2>;
-                          power-role = "sink";
-                          try-power-role = "sink";
-                          data-role = "device";
-                          source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
-                          sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)
-                                      PDO_VAR(3000, 12000, 3000)
-                                      PDO_PPS_APDO(3000, 11000, 3000)>;
-                          op-sink-microwatt = <10000000>;
-                      };
-                };
-                /*ONSEMI : Added PMIC FAN53880 entry*/
-		pmic@35 {

You need bootup dmesg or any specific one?

Sorry I took the patch in wrong way. I have attached corrected one.
PatchFile (6.9 KB)
Please refer this.

With Regards,
Ashwath BN

What is the situation now? Do you still need hotplug once to make it detected? Or it cannot be detected now?

I need the dmesg that can totally see the NG case and working case.

Yes, I need to hot plug to detect it. Refer the dmesg log for non working case
dmesg_bootup.log (65.0 KB)
After hot plug it get’s detected. Refer the log
dmesg_hotplug.log (1.6 KB)

Hi,

  1. Please again check the device role is correct in boot up case (NG case).

cat /sys/class/usb_role/usb2-2-role-switch/role

  1. dump below registers

sudo busybox devmem 3520360
sudo busybox devmem 3520364
sudo busybox devmem 3520368
sudo busybox devmem 352036c

You can also compare the result between NG case and working case of above results.

Not working case

nx@linux:~$ sudo cat /sys/class/usb_role/usb2-2-role-switch/role
device
nx@linux:~$

Considering this address are hex address so appenidng 0x.

nx@linux:~$ sudo busybox devmem 0x3520360
0x00215049
nx@linux:~$ sudo busybox devmem 0x3520364
0x00211040
nx@linux:~$ sudo busybox devmem 0x3520368
0x00211040
nx@linux:~$ sudo busybox devmem 0x352036C
0x00211040
nx@linux:~$

Working case

nx@linux:~$ sudo cat /sys/class/usb_role/usb2-2-role-switch/role
device

Register dump

nx@linux:~$ sudo busybox devmem 0x3520360
0x00215049
nx@linux:~$ sudo busybox devmem 0x3520364
0x00211040
nx@linux:~$ sudo busybox devmem 0x3520368
0x00211040
nx@linux:~$ sudo busybox devmem 0x352036C
0x00211040
nx@linux:~$

Both reg dumps are same.

with Regards,
Ashwath BN

Could you dump the dmesg of host machine in the jetson boot up case (NG case)?

And what is the register dump of 0x355003c in NG case?

If the clear the host machine dmesg log and restart the Jetson nx device. After boot-up of Jetson nx device and if i do “sudo dmesg -c” on host machine no log present (i.e. I mean empty log) in not working case.

[sudo] password for nx: nx@linux:~$ sudo busybox devmem 0x355003c
0x000101C0

Hotplug(working case) and again do the “sudo dmesg -c” on host machine below log observed.

xavier-nx@xavier-nx:~$ sudo dmesg -c
[15117.135573] usb 3-4: new SuperSpeed USB device number 6 using xhci_hcd
[15117.156346] usb 3-4: New USB device found, idVendor=0955, idProduct=7020, bcdDevice= 0.02
[15117.156353] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[15117.156356] usb 3-4: Product: Linux for Tegra
[15117.156358] usb 3-4: Manufacturer: NVIDIA
[15117.156359] usb 3-4: SerialNumber: 1425021069038
[15117.161287] rndis_host 3-4:1.0 usb0: register ‘rndis_host’ at usb-0000:00:14.0-4, RNDIS device, 3e:db:f7:94:be:fe
[15117.162396] cdc_acm 3-4:1.2: ttyACM0: USB ACM device
[15117.164155] usb-storage 3-4:1.4: USB Mass Storage device detected
[15117.171653] scsi host2: usb-storage 3-4:1.4
[15117.192448] cdc_ncm 3-4:1.5: MAC-Address: e6:7c:84:8e:6e:b6
[15117.192645] cdc_ncm 3-4:1.5 usb1: register ‘cdc_ncm’ at usb-0000:00:14.0-4, CDC NCM, e6:7c:84:8e:6e:b6
[15117.242574] cdc_ncm 3-4:1.5 enxe67c848e6eb6: renamed from usb1
[15117.414380] IPv6: ADDRCONF(NETDEV_CHANGE): enxe67c848e6eb6: link becomes ready
[15118.200179] scsi 2:0:0:0: Direct-Access Linux File-Stor Gadget 0510 PQ: 0 ANSI: 2
[15118.200405] sd 2:0:0:0: Attached scsi generic sg1 type 0
[15118.200620] sd 2:0:0:0: Power-on or device reset occurred
[15118.201005] sd 2:0:0:0: [sdb] 32768 512-byte logical blocks: (16.8 MB/16.0 MiB)
[15118.201116] sd 2:0:0:0: [sdb] Write Protect is on
[15118.201120] sd 2:0:0:0: [sdb] Mode Sense: 0f 00 80 00
[15118.201264] sd 2:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn’t support DPO or FUA
[15118.202315] sdb:
[15118.203200] sd 2:0:0:0: [sdb] Attached SCSI removable disk

Reg dump after hotplug(working case)

nx@linux:~$ sudo busybox devmem 0x355003c
0x00001043