gadgetfs problemes -

Hi,
I am experimenting with the beagleboard C4 trying to get the USB OTG
work as a USB device. Prefrerrably to build up bulk enpoints to
communicate with an libusb application on a PC.
I am trying it with the example from http://www.linux-usb.org/gadget/usb.c.
gadgetfs seems to work to a certain extent because i can see that the
example code reaches the chip detection and succesfully reports "/dev/
gadget/musb_hdrc ep0 configured".
But then it keeps stuck somewhere in the threads. I can see ep0_thread
is entered after displaying the random serial number. But thats it. No
output anymoe and nothing happens on the USB link.
(Monitored with beagle USB 480 logger)

Could anyone assist me, or is something strategical wrong with my
setup?

Regards,
Christ

Is it getting enumerated on your PC successfully? If so, your libusb
application on your PC has to connect to this device on your
Beagleboard and send random data to it.
The current code behaves as a loopback transmitter, whereby its taking
data it receives and sending it back to the host.

Jerry

Hi,
the problem is its not getting enumerated at all. Nothing happens on
the bus. The beagle USB 480 monitors any packet on the bus and nothing
happens.
The problem is, that i do not know where to look in the gadgetfs 'file
system'. It seems to me as if the 'usb-chip' is connected correctly
becaus of "gadgetfs: bound to musb_hdrc driver" when looking with
dmesg.
Before experminting with the beagle as a device, the beagleboard used
as a host with the USB Host port (and my libusb application)
communicates succesfully with an embedded ATMEL device.
The application does succesfully autoconfig the chip (autoconfig()
returns 0).
But if I understand ep0_thread correctly, it somehow waits for events.
And obviously these events do not occur in the event loop.

I'm glad for all advices.
Regards,
Chris

First of all, did you get a kernel compiled with gadgetfs support as
well as peripheral USB support?
Once that is done, you then have to mount gadgetfs to /dev/gadget.
Finally, you start up the application, which should pop up a message
to your windows machine denoting that a new USB device has connected.

I've had no issues with the application myself, and have been using it
with a custom protocol on the PC-side using QT/Libusb to do some
client-side flashing.

Jerry

Thanks for you reply Jerry.
I haven't yet compiled the kernel myself. Its an angstrom precompiled
kernel with gadgetfs support.
I am trying to figure out what is compiled into the kernel. Mounting
using gadgetfs filesystem works.
Maybe peripheral USB support is not compiled.

Can someone give me hint where to look,
when i want to know which options were used when the kernel was
compiled?

zcat /proc/config.gz

There’s a file in /proc or /sys but I forget its name (and it itself needs a config option to be turned on). But anyway, the kernel compile config for Angstrom is here:

http://www.angstrom-distribution.org/demo/beagleboard/config-2.6.32-r70+gitr7b8926aa626991fa087b00f6bbc1fb6b0e8269b0-beagleboard.config

Thanks for all your replies. They helped to understand whats wrong.
Now it seems as if peripheral-support is not compiled into the kernel.
Is it right that I need to recompile the kernel somehow with enabling
the option?
Additionally I didn't find /proc/config.gz so I don't know what is
really in my kernel.
Now I wonder how to recompile the angstrom kernel ... any hints to
that?

Thanks for all your replies. They helped to understand whats wrong.
Now it seems as if peripheral-support is not compiled into the kernel.
Is it right that I need to recompile the kernel somehow with enabling
the option?

The angstrom kernel has peripheral support by default, it's just using OTG to enable host mode as well. That is evidenced by being able to load gadget drivers and have them working.

Additionally I didn't find /proc/config.gz so I don't know what is
really in my kernel.

The angstrom kernel has /proc/config.gz support enabled by default

Now I wonder how to recompile the angstrom kernel ... any hints to
that?

Have you tried going to http://www.angstrom-distribution.org?

regards,

Koen

@koen: sorry, I now found donfig.gz and the parameters
Something confuses me:
Obviously the OTG port can run in device mode. Trying to make use of
g_ether works fine, and this shows me device mode works. Doesn't it?
I managed to make g_zero enumerate with the Ubuntu-Pc, but testusb
isn't able to run a test at all. Obviously it needs the old proc
devices, which need usbfs in the kernel.
I built a new ubuntu kernel with including gadgetfs and usbfs was
available but testusb just produced errors.
So my question is: I want to use one beagleboard to communicate with
another Host-Beagleboard that is using libusb. Is it right that I need
gadgetfs or g_zero to create a software that handles the beagleboard
as a usb device?
I miss a starting point on where to look at to achieve my goals.

Could anyone give a hint?