Hi,
i try to make a USB virtual network.I hope PC can communicate with jetson TX2 via USB port. For example, run shell command “ifconfig -a”,then show all network device including “usb0”
Yes,i flash TX2 with r28.2.1. And i download Jetpack 3.3, and flash the TX2 with command “sudo ./flash.sh jetson-tx2 mmcblk0p1”.
In the kernel top folder “public_sources/kernel_src/kernel/kernel-4.4/”, build and install the kernel as following steps
1.firstly, set the default config file
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- tegra18_defconfig
2.secondly, built the kernel
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j4
3.copy the kernel file to the fold to be flashed
cp -arf arch/arm64/boot/Image /home/Jetpack3.3/64_TX2/Linux_for_Tegra/kernel
cp -arf arch/arm64/boot/Image /home/Jetpack3.3/64_TX2/Linux_for_Tegra/rootfs/boot/
4.flash the jetson TX2 in recovery mode
sudo ./flash.sh jetson-tx2 mmcblk0p1
I’m looking at R28.2. This has an example ethernet gadget (USB pretending to be an ethernet adapter) which shows from “ifconfig” as “usb1”. You can make adjustments to this without touching the kernel (well…you can make some adjustments, e.g., IP address). Examine:
On the dev carrier board only the micro-OTG port has the wiring to act as device. Unless you use a different carrier, then only this port, with a micro-B USB connector, can provide a device of any kind. Other ports can only be host mode on the dev carrier.
And I got rid of the Ethernet bridge and use the device directly:
#/sbin/brctl addbr l4tbr0
#/sbin/ifconfig l4tbr0 ${net_ip} netmask ${net_mask} up
if [ ${enable_rndis} -eq 1 ]; then
#/sbin/brctl addif l4tbr0 "$(cat functions/rndis.usb0/ifname)"
#/sbin/ifconfig "$(cat functions/rndis.usb0/ifname)" up
/sbin/ifconfig "$(cat functions/rndis.usb0/ifname)" ${net_ip} netmask ${net_mask} up
fi
if [ ${enable_ecm} -eq 1 ]; then
#/sbin/brctl addif l4tbr0 "$(cat functions/ecm.usb0/ifname)"
#/sbin/ifconfig "$(cat functions/ecm.usb0/ifname)" up
/sbin/ifconfig "$(cat functions/rndis.usb0/ifname)" ${net_ip} netmask ${net_mask} up
fi
Now it works as expected – it shows up as a USB ethernet adapter on my workstation. I set my IP to 192.168.55.2 (netmask 255.255.255.0), and I can ssh to 192.168.55.1.