TX2 and Xsens IMU through micro USB adapter

Hi everyone,

Just getting the TX2 one week ago and I’m trying to setting up some sensors for a project. I’m particularly interested to plug an IMU (xsens mti) on the micro usb A port using the micro usb / usb adapter provided with the Jetson.

However, when I plugged the IMU into the adapter I’m not able to see a /dev/ttyUSBX . So here are my questions :

1- Is it a reasonable idea to plug such a device through the micro usb / usb adapter ?
2- What should I do in order to make appear a /dev/ttyUSBX needed by the xsens driver ?

My revision of the Jetson :

nvidia@tegra-ubuntu:~$ head -n 1 /etc/nv_tegra_release
# R27 (release), REVISION: 1.0, GCID: 8566447, BOARD: t186ref, EABI: aarch64, DATE: Thu Mar  2 05:14:54 UTC 2017

My ubuntu is able to see the device (result of dmesg cmd) :

[ 5844.256158] tegra-xudc-new 3550000.xudc: device mode on
[ 5844.261422] tegra-xudc-new 3550000.xudc: device mode off
[ 5844.266919] tegra-usb-cd usb_cd: notification status (0x1, 0x0)
[ 5844.272916] tegra-usb-cd usb_cd: disconnected USB cable/charger
[ 5844.278884] tegra-usb-cd usb_cd: set current 0ma
[ 5844.283537] tegra-xudc-new 3550000.xudc: entering ELPG
[ 5844.289910] tegra-xudc-new 3550000.xudc: entering ELPG done
[ 5845.676700] extcon-gpio-states external-connection:extcon@1: Cable state 2
[ 5845.792755] extcon-gpio-states external-connection:extcon@1: Cable state 2
[ 5847.100448] usb 1-1: new full-speed USB device number 21 using xhci-tegra
[ 5847.234238] usb 1-1: New USB device found, idVendor=2639, idProduct=0003
[ 5847.241004] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 5847.248240] usb 1-1: Product: MTi-30 AHRS
[ 5847.252311] usb 1-1: Manufacturer: Xsens
[ 5847.256271] usb 1-1: SerialNumber: 036006B6
[ 5847.261481] xhci-tegra 3530000.xhci: tegra_xhci_mbox_work mailbox command 6

Thanks for your help !

Note: My other USB (3.0) is already in use by a high frame rate camera on the system.

There is no difference between the micro connector and the full-sized connector unless USB3 matters…the micro connector will be configured only for USB2. I doubt this will matter (this does matter on some devices which can’t function at slower bandwidth…those devices do not provide a USB2 compatibility mode). You could of course try it on the full-sized USB connector to temporarily test if it matters.

The log tends to indicate USB is doing what it should and making the device available for any driver which wants to claim it. I don’t see any message that says a driver claimed the device. If the device is a generic/standard device class, then you wouldn’t need any extra drivers; for the case of a device using its own drivers you would need to provide the driver before the ttyUSB# shows up. Even if the driver does take ownership sometimes the device special file name is not what is expected because of udev rules (this probably is not the case for this instance…a driver would still need to take ownership before any device special file would show up).

If you run “lsusb” your device should show up. On the line showing that device there will be an “ID”, it’s format something like “1234:5678”. To verbosely list information about that device (adjust the ID to your case):

sudo lsusb -d 1234:5678 -vvv

Hi linuxdev,

First, sorry for the late reply. Ok so indeed ubuntu seems to recognize the device correctly.

Bus 001 Device 007: ID 2639:0003 Xsens MTi-30 AHRS
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            2 Communications
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x2639 Xsens
  idProduct          0x0003 MTi-30 AHRS
  bcdDevice            0.00
  iManufacturer           1 Xsens
  iProduct                2 MTi-30 AHRS
  iSerial                 3 036006B6
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           48
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              200mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      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     0x0008  1x 8 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      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               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Status:     0x0000
  (Bus Powered)

Looking at the output of the lsusb and dmesg command I know my jetson is recognizing the IMU. I only miss the mounting point in /dev. I tried to add the following line in a /etc/udev/rules.d/99-custom.rules file :

SUBSYSTEM=="tty", ATTRS{idVendor}=="2639", ACTION=="add", GROUP="$GROUP", MODE="0660"

But without success. I’m pretty sure it’s a minor things cause’ when I plug it on Ubuntu of my laptop it gets mounted in /dev/ttyUSB0 and makes it possible to communicate with. On the driver side, I use a ROS package : https://github.com/ethz-asl/ethzasl_xsens_driver
The driver is a python script that implement the MT Protocol of Xsens imus.
I keep digging…

Small update to compare between the Jetson case and a desktop computer. Using “udevadm monitor” I got the following on the Jetson :

KERNEL[47.893030] add      /devices/3530000.xhci/usb1/1-1 (usb)
KERNEL[47.901166] add      /devices/3530000.xhci/usb1/1-1/1-1:1.0 (usb)
KERNEL[47.901489] add      /devices/3530000.xhci/usb1/1-1/1-1:1.1 (usb)
UDEV  [47.915806] add      /devices/3530000.xhci/usb1/1-1 (usb)
UDEV  [47.920950] add      /devices/3530000.xhci/usb1/1-1/1-1:1.1 (usb)
UDEV  [48.942292] add      /devices/3530000.xhci/usb1/1-1/1-1:1.0 (usb)

While I have the following on my desktop :

KERNEL[11295.426442] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb)
KERNEL[11295.426981] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 (usb)
KERNEL[11295.427077] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1 (usb)
KERNEL[11295.427120] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/ttyUSB0 (usb-serial)
KERNEL[11295.427383] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/ttyUSB0/tty/ttyUSB0 (tty)
UDEV  [11295.455142] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb)
UDEV  [11295.459760] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1 (usb)
UDEV  [11295.463256] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/ttyUSB0 (usb-serial)
UDEV  [11295.471243] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1/ttyUSB0/tty/ttyUSB0 (tty)
UDEV  [11296.469906] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 (usb)

I, somehow, miss the calls using ttyUSB*

Ok regarding http://thmosqueiro.vandroiy.com/2017-01/Nvidia-Jetson-ttyUSB0-drivers/ I was looking for the FTDI kernel module but it seems to be there. Looking at the config.gz file there is :

CONFIG_USB_SERIAL_FTDI_SIO=y

However I searched for “XSENS” and fall on :

# CONFIG_USB_SERIAL_XSENS_MT is not set

So I will try to recompile the kernel with this module support. I keep you updated.

Ok, I finally figure it out to make it works ! I followed this tutorial for the kernel compilation :
https://github.com/jetsonhacks/buildJetsonTX2Kernel and in the kernel module list I selected the CONFIG_USB_SERIAL_XSENS_MT module. Then copy the kernel in /boot and reboot my jetson.

Now usbserial is mounting the Xsens Imu on /dev/ttyUSB0. Thanks for your support (and time) !

NOTE: It was not related to the micro usb / usb adapter at all.