Configure hardware for USB OTG or USB device support

Build USB Ethernet network gadget driver

The USB Ethernet network gadget driver caused the device to appear to be a USB network dongle when connected to a host computer. Generally it is best to build USB gadget drivers as modules instead of building them into the kernel so you can unload one and load another.

Verifying network connectivity

On the host PC, verify the number of packet sent and received is not zero

ifconfig usb0

Look at the values of RX packets: and TX packets:.

Bridging host PC to allow device to reach the Internet

If your host PC is connected to the Internet (through WiFi or Ethernet), then you can allow the target device to share the host PC's Internet connection. The following shows how to enable, test, and disable. It only works if your host PC doesn't have a firewall enable. There is a lot of information on how the Internet giving more detailed explanation.

Configuring a DNS name server

If you need to resolve DNS names, you can configure your target hardware to use Google's DNS server via:

echo "nameserver 8.8.8.8" >> /etc/resolv.conf

and you can test that names get resolved by pinging some computer on the Internet:

ping -c 5 google.com

Mounting NFS file system

If you have already enabled NFS share of your development directory target file system, $DEVDIR/fs/fs, then you can easily mount the file system on the target. This is different than a root NFS mount. With a root NFS mount, networking has to be available when the kernel is booting. With a normal (non root file system) NFS mount, you are simply mounting a shared directory somewhere in the target device's file system.

First verify you build the target file system kernel with NFS enabled:

Debugging and resolving common errors

Wireshark

Wireshark is your friend. Run wireshark on your host PC monitoring the usb0 interface and you don't need any packet filters. If something isn't working, you will see the last packet that was sent and not responded to. That will give you a big hint as to where to start looking for the problem.

and you know you have root NFS working, the cause is due to a different sub-LAN address being used. On your host PC, you need to make sure the 10.0.1.* sub-LAN is exported. Run the following commands to export you home directory to all computers on this sub-LAN: