NVIDIA Tegra
DRIVE 5.0 Linux Open Source Software

Development Guide
5.0.10.3 Release


 
USB 3.0 Inter-Tegra Communication on DRIVE PX 2 (P2379) Platform
 
Inter-Tegra Communication on a DRIVE PX 2 (P2379) Platform
The NVIDIA DRIVE PX 2 (P2379) platform contains two NVIDIA® Tegra® chips that connect with Ethernet over USB through a USB cable attached to two of the connectors.
The USB connection uses Network Control Model (NCM) protocols of the Communications Device Class (CDC). You can configure the chips to communicate with one another, where Tegra A is the USB host and Tegra B is the USB device.
Inter-Tegra Communication on a DRIVE PX 2 (P2379) Platform
To enable inter-Tegra communication on a DRIVE PX 2 (P2379) platform you must:
1. Establish a Network Control Model (NCM) connection between the Tegra chips.
2. Verify that the two chips can communicate with each other.
Note:
USB 2.0 recovery port (which internally connected to USB2.0 Hub port) is not supported as device port after NCM support is added.
To set up the NCM connection between Tegra A and Tegra B
1. Power on the target.
2. Wait until boot completes on both Tegra chips.
3. Set theTegra B USB 3.0 port as device mode. On the Tegra B console, enter:
echo 0x0 > /sys/class/extcon/extcon0/state
echo 0x0 > /sys/class/extcon/extcon1/state
4. Connect a USB3.0 or USB2.0 A-to-A cable to the Tegra platform’s “Tegra A USB 3” and “Tegra B USB 3” connectors. (See the “Front View” figure under DRIVE PX 2 Platform, Hardware Connectors in the section Setting up DRIVE PX 2 AutoChauffeur (P2379).)
Note:
Do not connect the USB cable before this step.
5. Enable the Tegra B USB 3.0 port VBUS. On the Tegra B console, enter:
echo 0x1 > /sys/class/extcon/extcon1/state
6. Run the following script on the Tegra B console to enable the NCM gadget:
mkdir /sys/kernel/config/usb_gadget/g1
echo "0x1d6b" > /sys/kernel/config/usb_gadget/g1/idVendor
echo "0x0104" > /sys/kernel/config/usb_gadget/g1/idProduct
mkdir /sys/kernel/config/usb_gadget/g1/strings/0x409
echo "0123456789" > /sys/kernel/config/usb_gadget/g1/strings/0x409/serialnumber
echo "Nvidia Inc." > /sys/kernel/config/usb_gadget/g1/strings/0x409/manufacturer
echo "NCM Gadget" > /sys/kernel/config/usb_gadget/g1/strings/0x409/product
mkdir /sys/kernel/config/usb_gadget/g1/functions/ncm.inter_tegra
mkdir /sys/kernel/config/usb_gadget/g1/configs/c.1
mkdir /sys/kernel/config/usb_gadget/g1/configs/c.1/strings/0x409
echo "CDC NCM" > /sys/kernel/config/usb_gadget/g1/configs/c.1/strings/0x409/configuration
ln -s /sys/kernel/config/usb_gadget/g1/functions/ncm.inter_tegra /sys/kernel/config/usb_gadget/g1/configs/c.1
echo "3550000.xudc" > /sys/kernel/config/usb_gadget/g1/UDC
To verify the USB connection between Tegra A and Tegra B
1. On the Tegra A (USB host) console, enter:
root@nvidia:~# lsusb
If the command is successful it displays this output:
Bus 002 Device 060: ID 1d6b:0104 Linux Foundation Multifunction Composite Gadget
2. Set the Tegra chips’ IP addresses.
On the Tegra B console, enter:
ifconfig usb0 192.168.1.2
On the Tegra A console, enter:
ifconfig usb0 192.168.1.1
3. Run a ping test from Tegra B to Tegra A:
root@nvidia:~# ping 192.168.1.1
If the ping test is successful it displays output that resembles this:
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=3.76 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=2.11 ms
64
bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=2.07 ms
...and so on
4. Run a ping test from Tegra A to Tegra B:
root@nvidia:~# ping 192.168.1.2
If the ping test is successful it displays output similar to the first ping test.