Disable/enable USB ports on ORIN NX programmatically

Following this thread: Howto disable/enable USB p[orts on NX programmatically?

Is it possible to do something similar for the ORIN NX?
We’re using a Intel Realsense T265 which needs to be physically unplug and replug it every time to be detected…
I’ve already tried GitHub - mvp/uhubctl: uhubctl - USB hub per-port power control without success.

We’re not using the devKit but we’re using a Seeedstudio A203v2 or A603.
Datasheet: https://files.seeedstudio.com/products/NVIDIA/A603-Carrier-Board-for-Jetsson-Orin-NX-Nano-Datasheet.pdf

I wonder if it’s possible to restart the regulator instead.

Dmesg: dmesg_ORINNX.log (69.7 KB)
DTS: kernel_tegra234-p3767-0000-p3509-a02.dts.log (424.9 KB)

nvidia@nvidia-orin-rt:~$ lsusb -v

Bus 002 Device 002: ID 0bda:0411 Realtek Semiconductor Corp. USB3.2 Hub
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.20
  bDeviceClass            9 Hub
  bDeviceSubClass         0 
  bDeviceProtocol         3 
  bMaxPacketSize0         9
  idVendor           0x0bda Realtek Semiconductor Corp.
  idProduct          0x0411 
  bcdDevice            1.01
  iManufacturer           1 
  iProduct                2 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x001f
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes           19
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Feedback
        wMaxPacketSize     0x0002  1x 2 bytes
        bInterval               8
        bMaxBurst               0

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0 
  bDeviceProtocol         3 
  bMaxPacketSize0         9
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0003 3.0 root hub
  bcdDevice            5.10
  iManufacturer           3 
  iProduct                2 
  iSerial                 1 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x001f
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
        bMaxBurst               0

Bus 001 Device 003: ID 8087:0a2b Intel Corp. 
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          224 Wireless
  bDeviceSubClass         1 Radio Frequency
  bDeviceProtocol         1 Bluetooth
  bMaxPacketSize0        64
  idVendor           0x8087 Intel Corp.
  idProduct          0x0a2b 
  bcdDevice            0.10
  iManufacturer           0 
  iProduct                0 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x00b1
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0000  1x 0 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0000  1x 0 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0009  1x 9 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0009  1x 9 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       2
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0011  1x 17 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0011  1x 17 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       3
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0019  1x 25 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0019  1x 25 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       4
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0021  1x 33 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0021  1x 33 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       5
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0031  1x 49 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0031  1x 49 bytes
        bInterval               1

Bus 001 Device 004: ID 03e7:2150 Intel Myriad VPU [Movidius Neural Compute Stick]
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x03e7 Intel
  idProduct          0x2150 Myriad VPU [Movidius Neural Compute Stick]
  bcdDevice            0.01
  iManufacturer           1 Movidius Ltd.
  iProduct                2 Movidius MA2X5X
  iSerial                 3 03e72150
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0020
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass     17 
      bInterfaceProtocol    255 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0000
  (Bus Powered)

Bus 001 Device 002: ID 0bda:5411 Realtek Semiconductor Corp. USB2.1 Hub
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.10
  bDeviceClass            9 Hub
  bDeviceSubClass         0 
  bDeviceProtocol         2 TT per port
  bMaxPacketSize0        64
  idVendor           0x0bda Realtek Semiconductor Corp.
  idProduct          0x5411 
  bcdDevice            1.01
  iManufacturer           1 
  iProduct                2 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0029
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 
      bInterfaceProtocol      1 Single TT
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              12
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 
      bInterfaceProtocol      2 TT per port
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              12

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0002 2.0 root hub
  bcdDevice            5.10
  iManufacturer           3 
  iProduct                2 
  iSerial                 1 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0019
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12

If you are talking about devices behind that usb hub, then this tool may still works.

Hi @WayneWWW
I tried power_cycle but it doesn’t seem to work.

nvidia@nvidia-orin-rt:~$ rs-enumerate-devices
20/11 05:51:30,411 ERROR [281473637890304] (tm-boot.h:39) Error booting T265
20/11 05:51:33,423 ERROR [281473637890304] (tm-boot.h:39) Error booting T265
No device detected. Is it plugged in?
nvidia@nvidia-orin-rt:~$ cd power_cycle/
nvidia@nvidia-orin-rt:~/power_cycle$ sudo ./power_cycle
nvidia@nvidia-orin-rt:~/power_cycle$ rs-enumerate-devices
20/11 05:51:49,680 ERROR [281473218652416] (tm-boot.h:39) Error booting T265
20/11 05:51:52,693 ERROR [281473218652416] (tm-boot.h:39) Error booting T265
No device detected. Is it plugged in?

Even if I could see it restarted in the dmesg:

[ 160.468355] usb 1-2: USB disconnect, device number 2
[ 160.468363] usb 1-2.3: USB disconnect, device number 4
[ 160.688552] usb 2-1: USB disconnect, device number 2
[ 161.268926] usb 2-1: new SuperSpeed Gen 1 USB device number 3 using tegra-xusb
[ 161.298509] usb 2-1: New USB device found, idVendor=0bda, idProduct=0411, bcdDevice= 1.01
[ 161.298513] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 161.298515] usb 2-1: Product: USB3.2 Hub
[ 161.298516] usb 2-1: Manufacturer: Generic
[ 161.303164] hub 2-1:1.0: USB hub found
[ 161.304819] hub 2-1:1.0: 4 ports detected
[ 161.420492] usb 1-2: new high-speed USB device number 5 using tegra-xusb
[ 161.578202] usb 1-2: New USB device found, idVendor=0bda, idProduct=5411, bcdDevice= 1.01
[ 161.578205] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 161.578207] usb 1-2: Product: USB2.1 Hub
[ 161.578208] usb 1-2: Manufacturer: Generic
[ 161.579067] hub 1-2:1.0: USB hub found
[ 161.579792] hub 1-2:1.0: 4 ports detected
[ 161.868476] usb 1-2.3: new high-speed USB device number 6 using tegra-xusb
[ 161.971279] usb 1-2.3: config 1 interface 0 altsetting 0 bulk endpoint 0x81 has invalid maxpacket 64
[ 161.971284] usb 1-2.3: config 1 interface 0 altsetting 0 bulk endpoint 0x1 has invalid maxpacket 64
[ 161.982279] usb 1-2.3: New USB device found, idVendor=03e7, idProduct=2150, bcdDevice= 0.01
[ 161.982282] usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 161.982284] usb 1-2.3: Product: Movidius MA2X5X
[ 161.982285] usb 1-2.3: Manufacturer: Movidius Ltd.
[ 161.982286] usb 1-2.3: SerialNumber: 03e72150

If I manually plug it out in and in again, I get:

[ 321.875523] usb 1-2.3: USB disconnect, device number 6
[ 331.480340] usb 1-2.4: new high-speed USB device number 7 using tegra-xusb
[ 331.586154] usb 1-2.4: New USB device found, idVendor=03e7, idProduct=2150, bcdDevice= 0.01
[ 331.586159] usb 1-2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 331.586161] usb 1-2.4: Product: Movidius MA2X5X
[ 331.586163] usb 1-2.4: Manufacturer: Movidius Ltd.
[ 331.586164] usb 1-2.4: SerialNumber: 03e72150

nvidia@nvidia-orin-rt:~/power_cycle$ rs-enumerate-devices
Device info:
Name : Intel RealSense T265
Serial Number : 230222110540
Firmware Version : 0.2.0.951
Physical Port : 2-1.4-4
Product Id : 0B37
Usb Type Descriptor : 3.1
Product Line : T200

Stream Profiles supported by Tracking Module
Supported modes:
stream resolution fps format
Fisheye 1 848x800 @ 30Hz Y8
Fisheye 2 848x800 @ 30Hz Y8
Gyro N/A @ 200Hz MOTION_XYZ32F
Accel N/A @ 62Hz MOTION_XYZ32F
Pose N/A @ 200Hz 6DOF

Are you talking about you can see device refreshed in dmesg after running script?

Yes, the camera was initially listed during the boot:

[ 4.062120] usb 1-2.3: new high-speed USB device number 4 using tegra-xusb
[ 4.164908] usb 1-2.3: config 1 interface 0 altsetting 0 bulk endpoint 0x81 has invalid maxpacket 64
[ 4.164915] usb 1-2.3: config 1 interface 0 altsetting 0 bulk endpoint 0x1 has invalid maxpacket 64
[ 4.167911] usb 1-2.3: New USB device found, idVendor=03e7, idProduct=2150, bcdDevice= 0.01
[ 4.167914] usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4.167916] usb 1-2.3: Product: Movidius MA2X5X
[ 4.167917] usb 1-2.3: Manufacturer: Movidius Ltd.
[ 4.167918] usb 1-2.3: SerialNumber: 03e72150

and the script correctly disconnects and reconnects it, according to the log.

[ 160.468355] usb 1-2: USB disconnect, device number 2
[ 160.468363] usb 1-2.3: USB disconnect, device number 4
[ 160.688552] usb 2-1: USB disconnect, device number 2

[ 161.868476] usb 1-2.3: new high-speed USB device number 6 using tegra-xusb
[ 161.971279] usb 1-2.3: config 1 interface 0 altsetting 0 bulk endpoint 0x81 has invalid maxpacket 64
[ 161.971284] usb 1-2.3: config 1 interface 0 altsetting 0 bulk endpoint 0x1 has invalid maxpacket 64
[ 161.982279] usb 1-2.3: New USB device found, idVendor=03e7, idProduct=2150, bcdDevice= 0.01
[ 161.982282] usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 161.982284] usb 1-2.3: Product: Movidius MA2X5X
[ 161.982285] usb 1-2.3: Manufacturer: Movidius Ltd.
[ 161.982286] usb 1-2.3: SerialNumber: 03e72150

Unfortunately it doesn’t seem to behave as a physical disconnection though. I still have to detach and reattach the usb camera, If I want the Intel SDK to recognize it with rs-enumerate-devices

Not sure if this helps.

Thank you @WayneWWW for the link.
So, in the thread they suggest to build librealsense with BUILD_WITH_TM2=ON and It was already ON in my case.
Following the Intel instruction for the Jetsons (https://github.com/IntelRealSense/librealsense/blob/v2.53.1/doc/installation_jetson.md) I used RSUSB - user-space implementation of the UVC and HID data protocols, when I compiled it.

The last recent comment in that thread is from a user who fixed the detection problem with:

sudo sh -c "echo 141a0000.pcie > /sys/bus/platform/drivers/tegra194-pcie/unbind"
sudo sh -c "echo 141a0000.pcie > /sys/bus/platform/drivers/tegra194-pcie/bind"

I’m not sure if it can be reproducible with my ORIN NX.
Are my USBs connected to a PCIe card? Any way to test it?

I see 3 pcie symbolic links under /sys/bus/platform/drivers/tegra194-pcie

nvidia@nvidia-orin-rt:~$ ll /sys/bus/platform/drivers/tegra194-pcie
total 0
drwxr-xr-x 2 root root 0 Mar 27 2023 ./
drwxr-xr-x 228 root root 0 Mar 27 2023 …/
lrwxrwxrwx 1 root root 0 Nov 20 07:03 140a0000.pcie → …/…/…/…/devices/platform/140a0000.pcie/
lrwxrwxrwx 1 root root 0 Nov 20 07:03 14100000.pcie → …/…/…/…/devices/platform/14100000.pcie/
lrwxrwxrwx 1 root root 0 Nov 20 07:03 14160000.pcie → …/…/…/…/devices/platform/14160000.pcie/
–w------- 1 root root 4096 Nov 20 07:03 bind
–w------- 1 root root 4096 Mar 27 2023 uevent
–w------- 1 root root 4096 Nov 20 07:03 unbind

sudo sh -c “echo 14100000.pcie > /sys/bus/platform/drivers/tegra194-pcie/unbind”

Disconnects the wifi M2 card

sudo sh -c “echo 14a00000.pcie > /sys/bus/platform/drivers/tegra194-pcie/unbind”
sh: 1: echo: echo: I/O error
nvidia@nvidia-orin-rt:~$ sudo sh -c “echo 14160000.pcie > /sys/bus/platform/drivers/tegra194-pcie/unbind”
nvidia@nvidia-orin-rt:~$ ls
-bash: /usr/bin/ls: Input/output error

The other two breaks I/O apparently.

Hi,

Actually I am talking about this.

In my case, I was using a T265 tracking camera. After reading Release Notes on GitHub at Home · IntelRealSense/librealsense Wiki · GitHub I reinstalled Intel Realsense Viewer with version 2.48.0 (the first version was 2.54.1), then it worked correctly! The device displayed as Intel(R) RealSense™ Tracking Camera T265 instead of Movidius MA2X5X.

I see. I actually installed 2.53.1 which is the last version which supported T265. The user had problems with 2.54.1 because T265 has been removed.

I mean, I don’t think it’s a problem of the library per se. As you can see from my tests, manual detach and reattach works. I can watch the camera, get the pose etc.

If there’s a reliable way to reset the USB/hub and the device itself, that would work I guess.

There is no other way. The tool I shared is the only way to control the hub.

The power of that hub is always-on when jetson system power is on.

What is the difference in dmesg when you plug-out-in the camera with the default boot up case?

I see two differences:

  1. With power_cycle it shows these two warnings:

[ 201.094732] usb 1-2.3: new high-speed USB device number 9 using tegra-xusb
[ 201.201601] usb 1-2.3: config 1 interface 0 altsetting 0 bulk endpoint 0x81 has invalid maxpacket 64 <------
[ 201.201605] usb 1-2.3: config 1 interface 0 altsetting 0 bulk endpoint 0x1 has invalid maxpacket 64 <------
[ 201.204597] usb 1-2.3: New USB device found, idVendor=03e7, idProduct=2150, bcdDevice= 0.01

which are not present with manual reattaching.

  1. device number is increased by 1.

I don’t see others.

Then I feel this issue is not a problem from jetson USB driver.

Usb driver always detects the camera, right? lsusb can see this device no matter it is in working and NG case.

Yes the USB drivers work. lsusb always list the Intel camera.

I’d like to try the bind/unbind of the corresponding pcie, if any is present in my system.
Do you know how can check which pcie is behind my usb hub? Any way to find it?

I guess that pcie thing is totally not related.

If you want to check, you can check lspci command.

nvidia@nvidia-orin-rt:~/drone-racing$ lspci
0001:00:00.0 PCI bridge: NVIDIA Corporation Device 229e (rev a1)
0001:01:00.0 Network controller: Intel Corporation Wireless 8265 / 8275 (rev 78)
0004:00:00.0 PCI bridge: NVIDIA Corporation Device 229c (rev a1)
0004:01:00.0 Non-Volatile memory controller: Phison Electronics Corporation Device 5013 (rev 01)
0008:00:00.0 PCI bridge: NVIDIA Corporation Device 229c (rev a1)
0008:01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)

I don’t read anything Intel related.
I guess there is no way to fix this issue. Thanks for helping

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

Returning to the original question
Is there a way to cut off power to Orin NX USB port then reenable it with some command like below:

SOLVED

sudo sh -c "echo 141a0000.pcie > /sys/bus/platform/drivers/tegra194-pcie/unbind"
sudo sh -c "echo 141a0000.pcie > /sys/bus/platform/drivers/tegra194-pcie/bind"

Find the PCIe card to which the USB is connected. In my case `141a0000.pcie`. The above command will turn the power supply to the PCIe card off and then on thereby making my T265 tracker camera detectable.

[source realsense intel discussion]
@WayneWWW ?
If possible which exactly value to put instead of 141a0000.pcie?
Thanks
AV