cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Explorer
Explorer
10,726 Views
Registered: ‎07-05-2017

USB as Ethernet Gadget

Jump to solution

Hi,

I'm using petalinux 2017.3 build in a Zedboard. Followed the link http://www.wiki.xilinx.com/Zynq+Linux+USB+Device+Driver the section where it enables the USB for Ethernet Gadget. The Kernel configuration was not quite the same as in the link above; nevertheless, I was able to get the USB Ethernet Gadget configuration done. When I connect the Zedboard USB Peripheral to a Windows PC host, I see the enumeration take place and in the Windows device manager " USB Ethernet/RNDIS Gadget" is detect and appears. See figure below of the device manager on the host windows side.

 

Capture.PNG

 

Here is where I tried to set up the IP address of the host as 10.10.70.2  (Note I set up the USB0 on the Petlinux Zedboard to 10.10.70.1) I'm just not sure If this is how one sets up the IP address on the USB gadget driver address property on the Windows side. See the figure below.

 

addr_property.PNG

 

I tried to ping to the 10.10.70.2 address on the host windows side (Ping to self)  but got timeouts.

 

ping.PNG

 

On the zedboard (Peripheral) pinged to self (10.10.70.1) works.

 

What could be the problem with my setup on the windows?

 

Thanks!

 

 

 

 

0 Kudos
Reply
1 Solution

Accepted Solutions
Explorer
Explorer
11,022 Views
Registered: ‎07-05-2017

Ok, figured out IPV4 configuration on the Windows host of the Ethernet RNDIS driver. Had to Right click on Windows 10 icon and select the "Network Connecitons" and found the "USB Ethernet/RNDIS Gadget" installed. Select and follow the IPV4 configuration for IP address. See figures below.

network_conn.PNGconn_prop.PNGip_prop.PNGping_good.PNG

 

 

Now I can ping both ways Windows (host) to Zedboard, and Zedboard (device) to windows. Will try to run my socket based programs to transfer data.

 

 

 

 

View solution in original post

3 Replies
Explorer
Explorer
11,023 Views
Registered: ‎07-05-2017

Ok, figured out IPV4 configuration on the Windows host of the Ethernet RNDIS driver. Had to Right click on Windows 10 icon and select the "Network Connecitons" and found the "USB Ethernet/RNDIS Gadget" installed. Select and follow the IPV4 configuration for IP address. See figures below.

network_conn.PNGconn_prop.PNGip_prop.PNGping_good.PNG

 

 

Now I can ping both ways Windows (host) to Zedboard, and Zedboard (device) to windows. Will try to run my socket based programs to transfer data.

 

 

 

 

View solution in original post

Explorer
Explorer
10,493 Views
Registered: ‎07-05-2017

:

# mount /dev/mmcblk0p1 /mnt

# cd /mnt

mnt # ./ethscript.sh

 

The script I created ethscript.sh or name it anything else. It loads the proper drivers on the petalinux build.  It looks like this below.  I just copied it to the SD card. I run the command above after boot up.

 

 

cd /lib/modules/4.9.0-xilinx-v2017.3/kernel/drivers/usb/gadget/function/
modprobe usb_f_acm.ko
cd ../legacy
modprobe g_acm_ms.ko
modprobe g_ether.ko
insmod g_cdc.ko
cd
mount -t configfs none /sys/kernel/config/
cd /sys/kernel/config/usb_gadget
mkdir g1
cd g1
echo "64" > bMaxPacketSize0
echo "0x200" > bcdUSB
echo "0x100" > bcdDevice
echo "0x03FD" > idVendor
echo "0x0500" > idProduct
mkdir functions/rndis.rn0
mkdir configs/c1.1
ln -s functions/rndis.rn0 configs/c1.1/
echo "ci_hdrc.0" > UDC
cd
ifconfig -a
ifconfig usb0 10.10.70.1
ifconfig usb0 up

 

Then I plug in a USB cable to zedboard "USB OTG" port and plug the other end to a PC.

0 Kudos
Reply
Contributor
Contributor
6,492 Views
Registered: ‎12-03-2018

Hi aynilian,

Please tell what device you using ? Micro Usb - ethernet or USB - ethernet ?

Thank you very much,

vanloc,

0 Kudos
Reply