This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

GadgetFS problem on BeagleBone

Hello,

I'm trying to use GadgetFS system with BeableBone white and am having some problems. I'd appreciate any pointers or help.

I'm using ti-sdk-am335x-evm-06.00.00.00 with custom built 3.2 kernel. I had to build the kernel since the default kernel did not enable GadgetFS.

I got the GadgetFS to successfully connected to windows 7 PC. On Windows, I'm using modified usbsamp driver from WinDDK 7600.16385.1. I can send small messages back and forth. But when I send long messages and/or a lot of messages back and forth, it seem to lock up. I also noticed that messages of size 512 bytes does not work. On the target size, I'm using modified http://www.linux-usb.org/gadget/usb.c. I changed musb_hdrc to musb-hdrc to get it to work.

Has any one been able to get GadgetFS working reliably with BeagleBone or EVM?

Thanks.

Brian

  • you can monitor the USB traffic using usbmon, you should see isochronous packets of length 18,

       ... S Zi:2:100:1 -115:8:5232 1 -18:0:512 512 <

    ... C Zi:2:100:1 0:8:5240:0 1 0:0:18 18 = e6010203 e6050607 e6090a0b e60d0e0f e611
    

    and you can also see, some kind of packet id (incrementing) in every 4 byte, the rest of the bytes are given by a mod 63 counter.

    you can test Bulk transfers  with the following commands (device and host):

    ./usbtest -a 5 -s 514
    ./testusb -a -t 4 -c 10 -s 1024
    

    testusb will complain, since the packet is short (514 instead of 1024), but usbmon still shows that the transfer has been done correctly:

    ... S Bi:2:101:1 -115 1024 <
    ... C Bi:2:101:1 -121 514 = 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  • Hi Nikunj,

    Thanks for the info. Are you using Linux as the host OS? I'm using Windows 7 x64 as the host OS. It seems to me that the problem is with the host PC driver I'm using. I tried WinUSB driver from WinDDK 7600.16385.1 as well as my own driver and both seem to have issues with 512 byte packet. I'll try libusb-win32 when I get a chance and see if that helps. For now, I think I can work around this problem by adding extra byte when ever I need to send 512 byte packet.

    I'd appreciate it if you can confirm that your host OS was Linux.

    Thanks

    Brian

  • Yes, my host OS was linux, i don't have any experience of GadgetFS on windows. It might be the problem with host PC driver you are using. but still you can add extra byte as work around.

    Best luck

     

  • Please first disable MUSB CPPI DMA in menuconfig to see if you have any problem.

  • Hello Bin,

    I already disabled DMA (using PIO mode only). With DMA mode enabled, it did not work correctly at all. At this point, I'm pretty sure it's the driver issue. I'll report back when I try libusb-win32. But I'm not sure when I'll get a chance.

    Thanks.

  • Brian,

    Thanks for the confirmation.

    The MUSB DMA driver in SDK 06.00.00.00 does not handle USB transactions which size is multiple of 512 bytes. For RX I have a patch to fixes it; but for TX, as you mentioned, the upper layer driver has to pad the packet.