[beagleboard] USB Networking problems in Lucid demo image

Hi,

(Previously mentioned in another thread; I'm posting again under a new
subject to avoid confusion)

I'm trying to get USB networking up between my Beagleboard and an
Ubuntu Lucid desktop machine.

I use the same desktp machine for with Neo Freerunner also using USB
networking, and have no problems with this.

The BB appears as a "cdc_emm" device, whereas the Freerunner appears
as "cdc_ether"

When connecting the Freerunner dmesg shows:

[81797.897555] eth1: register 'cdc_ether' at usb-0000:00:13.0-1, CDC
Ethernet Device, 00:1f:11:01:5e:ef
[81807.936029] eth1: no IPv6 routers present
...
[87049.339537] usb 5-1: USB disconnect, address 6
[87049.341236] eth1: unregister 'cdc_ether' usb-0000:00:13.0-1, CDC
Ethernet Device

When connecting the BB:

[87150.807422] usb0: register 'cdc_eem' at usb-0000:00:13.2-1, CDC EEM
Device, ca:c4:c6:93:06:90
[87161.084130] usb0: no IPv6 routers present
[87196.060737] usb 1-2.2: reset high speed USB device using ehci_hcd
and address 19
[87197.919976] usb 2-1: USB disconnect, address 13
[87197.920366] usb0: unregister 'cdc_eem' usb-0000:00:13.2-1, CDC EEM Device

I can see the interfaces on both sides, and have the network and
routes configured on both:

beagleboard:
ubuntu@beagleboard:~$ ifconfig usb0
usb0 Link encap:Ethernet HWaddr a2:2e:40:bd:82:1b
          inet addr:192.168.0.202 Bcast:192.168.0.255 Mask:255.255.255.0
          inet6 addr: fe80::a02e:40ff:febd:821b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:74 errors:0 dropped:0 overruns:0 frame:0
          TX packets:39 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:11527 (11.5 KB) TX bytes:2088 (2.0 KB)

ubuntu@beagleboard:~$ netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 usb0
0.0.0.0 192.168.0.200 0.0.0.0 UG 0 0 0 usb0

Desktop:
andrew@sauron:~$ ifconfig usb0
usb0 Link encap:Ethernet HWaddr ca:c4:c6:93:06:90
          inet addr:192.168.0.200 Bcast:192.168.0.255 Mask:255.255.255.0
          inet6 addr: fe80::c8c4:c6ff:fe93:690/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1494 Metric:1
          RX packets:0 errors:39 dropped:0 overruns:0 frame:0
          TX packets:53 errors:60 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B) TX bytes:9402 (9.4 KB)

andrew@sauron:~$ netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 usb0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 usb0
0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 eth0

When trying to ping from BB to desktop I get:

ubuntu@beagleboard:~$ ping -c 10 192.168.0.200
PING 192.168.0.200 (192.168.0.200) 56(84) bytes of data.
From 192.168.0.202 icmp_seq=1 Destination Host Unreachable
...
From 192.168.0.202 icmp_seq=10 Destination Host Unreachable

--- 192.168.0.200 ping statistics ---
10 packets transmitted, 0 received, +10 errors, 100% packet loss, time 9041ms
, pipe 3

Note the RX errors shown under ifconfig on the desktop. These
correspond exactly with attempts to ping the desktop from the BB, so
some kind of malformed packets are arriving from the BB. Wireshark
showed nothing.

I have been trying to build a new BB Ubuntu image using rootstock and
a different kernel:

sudo rootstock --fqdn beagleboard --login ubuntu --password temppwd
--imagesize 2G --seed
wget,linux-firmware,wireless-tools,usbutils,openssh-server,openssh-client,xorg,gdm,gnome-core,xserver-xorg-video-omap3
--dist lucid --serial ttyS2 --script fixup.sh --components "main
universe multiverse" --kernel-image
http://rcn-ee.net/deb/lucid/v2.6.34-rc6-l0/linux-image-2.6.34-rc6-l0_1.0lucid_armel.deb
--keepimage

This has been stalling at "Configuring libbsd0"

My next attempt will be to use the demo image, but replace the kernel
uImage, uInitrd and rootfs module tree manually.

Can anyone help?

Hi,

(Previously mentioned in another thread; I'm posting again under a new
subject to avoid confusion)

I'm trying to get USB networking up between my Beagleboard and an
Ubuntu Lucid desktop machine.

I use the same desktp machine for with Neo Freerunner also using USB
networking, and have no problems with this.

The BB appears as a "cdc_emm" device, whereas the Freerunner appears
as "cdc_ether"

When connecting the Freerunner dmesg shows:

[81797.897555] eth1: register 'cdc_ether' at usb-0000:00:13.0-1, CDC
Ethernet Device, 00:1f:11:01:5e:ef
[81807.936029] eth1: no IPv6 routers present
...
[87049.339537] usb 5-1: USB disconnect, address 6
[87049.341236] eth1: unregister 'cdc_ether' usb-0000:00:13.0-1, CDC
Ethernet Device

When connecting the BB:

[87150.807422] usb0: register 'cdc_eem' at usb-0000:00:13.2-1, CDC EEM
Device, ca:c4:c6:93:06:90
[87161.084130] usb0: no IPv6 routers present
[87196.060737] usb 1-2.2: reset high speed USB device using ehci_hcd
and address 19
[87197.919976] usb 2-1: USB disconnect, address 13
[87197.920366] usb0: unregister 'cdc_eem' usb-0000:00:13.2-1, CDC EEM Device

I can see the interfaces on both sides, and have the network and
routes configured on both:

beagleboard:
ubuntu@beagleboard:~$ ifconfig usb0
usb0 Link encap:Ethernet HWaddr a2:2e:40:bd:82:1b
inet addr:192.168.0.202 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::a02e:40ff:febd:821b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:74 errors:0 dropped:0 overruns:0 frame:0
TX packets:39 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:11527 (11.5 KB) TX bytes:2088 (2.0 KB)

ubuntu@beagleboard:~$ netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 usb0
0.0.0.0 192.168.0.200 0.0.0.0 UG 0 0 0 usb0

Desktop:
andrew@sauron:~$ ifconfig usb0
usb0 Link encap:Ethernet HWaddr ca:c4:c6:93:06:90
inet addr:192.168.0.200 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::c8c4:c6ff:fe93:690/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1494 Metric:1
RX packets:0 errors:39 dropped:0 overruns:0 frame:0
TX packets:53 errors:60 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:9402 (9.4 KB)

andrew@sauron:~$ netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 usb0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 usb0
0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 eth0

When trying to ping from BB to desktop I get:

ubuntu@beagleboard:~$ ping -c 10 192.168.0.200
PING 192.168.0.200 (192.168.0.200) 56(84) bytes of data.
From 192.168.0.202 icmp_seq=1 Destination Host Unreachable
...
From 192.168.0.202 icmp_seq=10 Destination Host Unreachable

--- 192.168.0.200 ping statistics ---
10 packets transmitted, 0 received, +10 errors, 100% packet loss, time 9041ms
, pipe 3

Note the RX errors shown under ifconfig on the desktop. These
correspond exactly with attempts to ping the desktop from the BB, so
some kind of malformed packets are arriving from the BB. Wireshark
showed nothing.

I have been trying to build a new BB Ubuntu image using rootstock and
a different kernel:

sudo rootstock --fqdn beagleboard --login ubuntu --password temppwd
--imagesize 2G --seed
wget,linux-firmware,wireless-tools,usbutils,openssh-server,openssh-client,xorg,gdm,gnome-core,xserver-xorg-video-omap3
--dist lucid --serial ttyS2 --script fixup.sh --components "main
universe multiverse" --kernel-image
http://rcn-ee.net/deb/lucid/v2.6.34-rc6-l0/linux-image-2.6.34-rc6-l0_1.0lucid_armel.deb
--keepimage

This has been stalling at "Configuring libbsd0"

Yeap, this is a known problem with qemu...

https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/532733

My next attempt will be to use the demo image, but replace the kernel
uImage, uInitrd and rootfs module tree manually.

Yeah, that or the NetInstall method...

Can anyone help?

Sorry i can't help with the usb0 issue..

Do you see anything in my config that is potentially stopping this
compared with the Freerunner?

http://bazaar.launchpad.net/~beagleboard-kernel/%2Bjunk/2.6-stable/annotate/head:/patches/lucid-defconfig

Regards,

Hi,

(Previously mentioned in another thread; I'm posting again under a new
subject to avoid confusion)

I'm trying to get USB networking up between my Beagleboard and an
Ubuntu Lucid desktop machine.

I use the same desktp machine for with Neo Freerunner also using USB
networking, and have no problems with this.

The BB appears as a "cdc_emm" device, whereas the Freerunner appears
as "cdc_ether"

When connecting the Freerunner dmesg shows:

[81797.897555] eth1: register 'cdc_ether' at usb-0000:00:13.0-1, CDC
Ethernet Device, 00:1f:11:01:5e:ef
[81807.936029] eth1: no IPv6 routers present
...
[87049.339537] usb 5-1: USB disconnect, address 6
[87049.341236] eth1: unregister 'cdc_ether' usb-0000:00:13.0-1, CDC
Ethernet Device

When connecting the BB:

[87150.807422] usb0: register 'cdc_eem' at usb-0000:00:13.2-1, CDC EEM
Device, ca:c4:c6:93:06:90
[87161.084130] usb0: no IPv6 routers present
[87196.060737] usb 1-2.2: reset high speed USB device using ehci_hcd
and address 19
[87197.919976] usb 2-1: USB disconnect, address 13
[87197.920366] usb0: unregister 'cdc_eem' usb-0000:00:13.2-1, CDC EEM Device

I can see the interfaces on both sides, and have the network and
routes configured on both:

beagleboard:
ubuntu@beagleboard:~$ ifconfig usb0
usb0 Link encap:Ethernet HWaddr a2:2e:40:bd:82:1b
inet addr:192.168.0.202 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::a02e:40ff:febd:821b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:74 errors:0 dropped:0 overruns:0 frame:0
TX packets:39 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:11527 (11.5 KB) TX bytes:2088 (2.0 KB)

ubuntu@beagleboard:~$ netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 usb0
0.0.0.0 192.168.0.200 0.0.0.0 UG 0 0 0 usb0

Desktop:
andrew@sauron:~$ ifconfig usb0
usb0 Link encap:Ethernet HWaddr ca:c4:c6:93:06:90
inet addr:192.168.0.200 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::c8c4:c6ff:fe93:690/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1494 Metric:1
RX packets:0 errors:39 dropped:0 overruns:0 frame:0
TX packets:53 errors:60 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:9402 (9.4 KB)

andrew@sauron:~$ netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 usb0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 usb0
0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 eth0

When trying to ping from BB to desktop I get:

ubuntu@beagleboard:~$ ping -c 10 192.168.0.200
PING 192.168.0.200 (192.168.0.200) 56(84) bytes of data.
From 192.168.0.202 icmp_seq=1 Destination Host Unreachable
...
From 192.168.0.202 icmp_seq=10 Destination Host Unreachable

--- 192.168.0.200 ping statistics ---
10 packets transmitted, 0 received, +10 errors, 100% packet loss, time 9041ms
, pipe 3

Note the RX errors shown under ifconfig on the desktop. These
correspond exactly with attempts to ping the desktop from the BB, so
some kind of malformed packets are arriving from the BB. Wireshark
showed nothing.

I have been trying to build a new BB Ubuntu image using rootstock and
a different kernel:

[snip]

This has been stalling at "Configuring libbsd0"

Yeap, this is a known problem with qemu...

https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/532733

Thanks. There's a suggestion for that bug that seems to be working.
My image is still building ... (fingers crossed)

My next attempt will be to use the demo image, but replace the kernel
uImage, uInitrd and rootfs module tree manually.

Yeah, that or the NetInstall method...

Normally this would be a good suggestion, but NetInstall requires
network, and network is what I'm having problems with (I'm relying on
USB networking).

I guess I could try setting up a wireless adapter.

Sorry i can't help with the usb0 issue..

Do you see anything in my config that is potentially stopping this
compared with the Freerunner?

http://bazaar.launchpad.net/~beagleboard-kernel/%2Bjunk/2.6-stable/annotate/head:/patches/lucid-defconfig

The Freerunner kernel has cdc_ether compiled in, and cdc_emm is not
set. I haven't got a toolchain set up yet to compile a new kernel so
I haven't been able to test whether this is the relevant difference.

andrew@sauron:~/Downloads$ diff bb-kernel_config freerunner-kernel-config
3,4c3,4
< # Linux kernel version: 2.6.33.3-l0 (Beagleboard)
< # Tue Apr 27 00:40:19 2010

This makes me think it may be similar to an issue I had with my
beagleboard:
I had set (with kernel module parameters) the "device" address to
00:11:22:33:44:55 and the host to 00:12:34:56:78:ab, and when I
wireshark'd usb0 on the host, I saw packets from "ff:ff:00:11:22:33"
of unknown ether type "4455". This looks like a framing error.

The way I fixed it was simple: I added "g_ether.use_eem=0" to u-boot's
kernel parameters on the beagleboard -- this forces it to use
cdc_subset instead. I don't recall whether that's still necessary,
though.

If you have a chance, give this uImage and modules a shot... I
tweaked the defconfig to match your freerunner's config... If it'll
works for you, i'll bump the release and build it...

http://rcn-ee.homeip.net:81/dl/testing/usbnet/

-CONFIG_USB_USBNET=m
+CONFIG_USB_USBNET=y
CONFIG_USB_NET_AX8817X=m
-CONFIG_USB_NET_CDCETHER=m
-CONFIG_USB_NET_CDC_EEM=m
+CONFIG_USB_NET_CDCETHER=y
+# CONFIG_USB_NET_CDC_EEM is not set
CONFIG_USB_NET_DM9601=m
CONFIG_USB_NET_SMSC95XX=m
CONFIG_USB_NET_GL620A=m
CONFIG_USB_NET_NET1080=m
CONFIG_USB_NET_PLUSB=m
CONFIG_USB_NET_MCS7830=m
-CONFIG_USB_NET_RNDIS_HOST=m
+CONFIG_USB_NET_RNDIS_HOST=y

Regards,

Robert Nelson
http://www.rcn-ee.com/

If you have a chance, give this uImage and modules a shot... I
tweaked the defconfig to match your freerunner's config... If it'll
works for you, i'll bump the release and build it...

http://rcn-ee.homeip.net:81/dl/testing/usbnet/

Success:

ubuntu@beagleboard:~$ ping 192.168.0.200
PING 192.168.0.200 (192.168.0.200) 56(84) bytes of data.
64 bytes from 192.168.0.200: icmp_seq=1 ttl=64 time=3.26 ms
64 bytes from 192.168.0.200: icmp_seq=2 ttl=64 time=0.488 ms
64 bytes from 192.168.0.200: icmp_seq=3 ttl=64 time=0.428 ms
64 bytes from 192.168.0.200: icmp_seq=4 ttl=64 time=0.458 ms

Thanks for testing..

I've committed the change so the next version 2.6.33.3-[xi]3 will have
the config tweak...

*note for lucid users (2.6.33.x), use the maverick kernel for the
moment, running into a bug with lucid's gcc that makes it unbootable..

Regards,

If you have a chance, give this uImage and modules a shot... I
tweaked the defconfig to match your freerunner's config... If it'll
works for you, i'll bump the release and build it...

http://rcn-ee.homeip.net:81/dl/testing/usbnet/

Success:

[snip]

Thanks for testing..

I've committed the change so the next version 2.6.33.3-[xi]3 will have
the config tweak...

Thanks :slight_smile:

I've now done some further reading[1][2] on the difference between CDC
ECM (aka CDC Ethernet) and CDC EEM, and it looks as though EEM is the
technically superior option for USB networking, but I haven't been
able to find any way of actually making it work for me (Ubunti Karmic
or Lucid ia32 hosts).

I've now set up an OE toolchain and will try poking at this (time
permitting) to see if I can find a way to get it working.

[1] http://www.usb.org/developers/devclass_docs/CDC_EEM10.pdf
[2] Re: [linux-usb-devel] Questions on CDC EEM