[beagleboard] USB host not working on Black?

With the limited details (exactly what image?) make sure the usb
device is plugged in before power on.. USB hotplug is not working

Regards,

Hi Robert,

I’m actually using the latest raring image from your site. I also tried your Debian 7 image for kicks. I have tried plugging things in before powering on, no luck at least as far as seeing something in dmesg or lsusb. I did notice that one of my USB sticks with an LED will light up when plugged in before booting (and not if doing hotplug). But other than that, I’m completely stumped. Going to try Angstrom.

Is there any kind of debugging I could do?

Tried in the default Angstrom image, same thing.

Do I need to adjust my expectations or something? If I plug in a mouse or a flash drive (prior to booting), I should see something in dmesg or lsusb, right?

Otherwise this has to be a defective BBB right?

USB is not “defective”, the problem is software, not hardware. It seems the 3.8 kernel has issues with hot plugging. Mine does the same, but if I plug in the USB device and then power up, it works just fine. Until this is fixed, there is a workaround here:
https://groups.google.com/forum/?fromgroups#!searchin/beagleboard/usb/beagleboard/8aalvyWwaig/MUXAPuMTSOYJ

That is correct. It works once and then will not after that. It is a SW issue.

Gerald

I’m not even trying to do hotplugging at this point. Even having something connected prior to boot doesn’t work.

Can I assume that this is the case with the latest image as well?

Gerald

Yes. Latest Angstrom (read: BBB factory image), Debian, and Ubuntu.

Is there any kind of advanced diagnostics I could do?

Not that I know of.

Gerald

Yes. Latest Angstrom (read: BBB factory image), Debian, and Ubuntu.

Is there any kind of advanced diagnostics I could do?

Hi Curtiss,

Your question got me thinking - to find a way to get a little more (albeit overview level) understanding of BBB <—> USB-device activity. I tried attaching a few USB devices myself. Some worked and some did not (partially). This is what I did to make some progress:

  • I obtained the source for usbdump from:

  • http://biot.com/usbdump/- and untar’d to a local dir like so:

  • ~/myutils/usbdump-1.0- Compiled (ignore warnings) using:

  • gcc -O2 -Wall usbdump.c -o usbdump- shutdown the BBB, attached a Poloroid (PNY) 16GB USB stick to the BBB and powered in back up

  • Via PC/BBB-usb, ran the following commands (via a bash script):

  • echo -e “\nTime Now …:” && date &&

    echo -e “\nMount …:” && mount &&

    echo -e “\nPartitions …:” && cat /proc/partitions &&

    echo -e “\nBlocks …:” && lsblk &&

    echo -e “\nUSB Device List …:” && lsusb -t &&
    echo -e “\nUSB Device Details :” && usb-devices && echo -e “\n”- Some the useful (snippets of) results were like so:

  • Mount …:

    /dev/sda1 on /media/USB20FD type vfat (rw,nosuid,nodev,relatime,fmask=0022,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro)

    Partitions …:
    major minor #blocks name

    8 0 15663104 sda <<< USB stick
    8 1 15661992 sda1

    Blocks …:
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    sda 8:0 1 15G 0 disk
    `-sda1 8:1 1 15G 0 part /media/USB20FD <<< USB stick

    USB Device List …:
    /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=musb-hdrc/1p, 480M
    /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=musb-hdrc/1p, 480M

    __ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 480M <<< USB stick

    USB Device Details :

    T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0
    D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
    P: Vendor=154b ProdID=0048 Rev=81.92
    S: Manufacturer=PNY Technologies <<< USB stick, with needed mA info below
    S: Product=USB 2.0 FD
    S: SerialNumber=AAAC090D000000DD
    C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=300mA
    I: If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

    (details of this last output can be found at places like:
    http://www.kneuro.net/cgi-bin/lxr/http/source/Documentation/usb/proc_usb_info.txt?a=ppcYou
    )

  • If you are able to gather info like above, then there is some level of interaction between BBB and the attached USB device. If not, you may need to attach another “known working” device and repeat. If this also fails, may be the USB port on BBB is non-functional, worthy of an RMA. Before that, if you wish, you may be able to get more usb analysis tools to get to work.

  • If basic usb connectivity is validated, then you can use the usbdump tool to check further. From above we get the device’s vendorid and pid and use it with the usbdump tool (from ~/myTools/usbdump) like so:

  • ./usbdump -d 154b:0048

  • You should see bi-directional (steady-state) data flow. If so, this is again a good indicator that the basics are working as expected

  • I was able to test further by:

  • by bringing up a vncviewer session on the host PC

  • running term and cd’ing to the USB stick (sda1 → /media/USB20FD)

  • running a simple command like “ls -lsa” in the term.

  • this cause a lot of hexdump. Have not analyzed it further, but sure looks like there is bi-directional functioning activity.

It would’ve been more helpful if the powerful usbmon util was part of the Angstrom image. As of the 05/20/13 image, I think one would have to build the Angstrom kernel oneself, after including the required usbmon components - to use usbmon on the BBB. You may be able to do that meanwhile… my next mini project is to do the same and learn a lil more of linux in the process :slight_smile:

Wireshark is another util, but I think it requires usbmon.

There is also this USBSniffer util that BB folks have deployed in the 3.2 kernel for BB:

This might be another candidate for migration to BBB (for the BBB s/w team ;?)

hth,
/venkat

PS: Thanks to the original authors at the links.

Just realized, you may also have better luck with ubuntu + (apt-get’ing usbmon)…
/v

Hi Venkat,

Thanks for the info. Just an update, I actually have gotten one USB device to (sometimes) be recognized. In general I’m finding my BBB’s USB support to be very, very flaky. I’ll look at the tool you posted, thanks.

By the way, I just noticed that Koen submitted a patch a few hours ago for the USB hot plugging. I haven’t tried it yet, but I probably will tomorrow. You can find the patch here:
https://github.com/beagleboard/kernel/commit/35a3abaaa7a44cdec3e4c63407b48d7cdc2a8533

By the way, I just noticed that Koen submitted a patch a few hours ago for the USB hot plugging. I haven't tried it yet, but I probably will tomorrow. You can find the patch here:
3.8: add usb hotplug fix · beagleboard/kernel@35a3aba · GitHub

That's present in the latest angstrom build (05.27) already: http://downloads.angstrom-distribution.org/demo/beaglebone/

Thanks for pointing that out, I wouldn’t have found it since neither of the usual locations showed the new version.

http://beagleboard.org/latest-images
http://circuitco.com/support/index.php?title=Updating_The_Software#Procedure

I will be posting the 5_28 image soon I hope. Waiting for Jason to put it on the S3 sever since early this morning.

Gerald

I will be posting the 5_28 image soon I hope. Waiting for Jason to put it on the S3 sever since early this morning.

Use the 5.27 image

In my case, not only hotplug isn’t working, also when I reboot the BBB or white BB on 3.8.X it does not detect the USB device correctly; in my case the USB device is self powered so it doesn’t reboot/restart on BBB reboots. This mode do work on white BB with 3.2.X Kernels.

Juanjo,

Try the 5-27 flasher

it has the hotplug fix in it

I downloaded both the 2013.05.27 and 2013.05.28 images. I tried the 28 image first and USB hot plug was not working correctly - would not recognize a hub or HID mouse that were plugged in after boot.

I haven't had time to try the 27 image yet - did this regress in the 28 image or should it work in both?