Setting up RNDIS

The devkit provides one USB 2.0 Dual-Role port that can be used. On a custom baseboard, the second USB 2.0 port could also be setup as Dual Role if required.

Configuring devkit as dhcp server

Configuring systemd to setup usb0 as DHCP server, assigning the devkit ip to and a connected PC to ip

Doing it this way makes it easy to connect to a PC as by default Windows tries to get an address over dhcp. However, it does mean that having multiple devkits connected to the same PC won't work as they will all get the same IP address on the same subnet. To get that to work, each devkit would need to be on a separate subnet so the PC could tell which interface to send traffic to.

Note: The latest yocto filesystem should already have these files in place.;a=commit;h=f0a02d1ec77a2cc1e22e5f915379c75afb895eac

Setups up any usb* network interfaces




# DHCP Pool will be size 1 starting at

Loads the RNDIS g_ether module on boot



To manually load g_ether:

modprobe g_ether

Example log:

[  200.005236] using random self ethernet address
[  200.009707] using random host ethernet address
[  200.015432] usb0: HOST MAC d6:61:fd:d5:9f:4f
[  200.020262] usb0: MAC 82:94:36:23:f5:c5
[  200.024354] using random self ethernet address
[  200.028827] using random host ethernet address
[  200.033434] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[  200.040083] g_ether gadget: g_ether ready
[  200.055458] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
[  200.814260] g_ether gadget: super-speed config #1: CDC Ethernet (ECM)
[  200.844330] IPv6: ADDRCONF(NETDEV_CHANGE): usb0: link becomes ready

root@mitysom-am62x:~# ifconfig usb0
usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
        inet  netmask  broadcast
        inet6 fe80::3413:c9ff:fe10:5ee1  prefixlen 64  scopeid 0x20<link>
        ether 36:13:c9:10:5e:e1  txqueuelen 1000  (Ethernet)
        RX packets 153  bytes 19598 (19.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 38  bytes 7059 (6.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Configuring PC as dhcp server

If you plan on having multiple devkits connected to a PC without having to worry about manually changing dhcp settings on each devkit. Then setting up the PC as the dhcp server is best. This requires bridging all connecting rndis devices together so they all get addresses from the dhcp server and can be on the same subnet. This can be setup pretty easily on Linux, see the link below

Go to top
Add picture from clipboard (Maximum size: 1 GB)