Joe Dumas

i.MX53 Quick Start Board gadgetfs support

Discussion created by Joe Dumas on Aug 2, 2012
Latest reply on May 27, 2013 by m z

Hello everyone,

I am trying to implement a USB device in user mode using the gadgetfs module. I am working off from the sample file and adding the support for 'fsl-usb2-udc' by adding the following in the function autoconfig():

else if (stat (DEVNAME = "fsl-usb2-udc", &statb) == 0) {
device_desc.bcdDevice = __constant_cpu_to_le16 (0x0100),
fs_source_desc.bEndpointAddress = hs_source_desc.bEndpointAddress = USB_DIR_IN | 7;
EP_IN_NAME = "ep-a";
fs_sink_desc.bEndpointAddress = hs_sink_desc.bEndpointAddress = USB_DIR_OUT | 3;
EP_OUT_NAME = "ep-b";
source_sink_intf.bNumEndpoints = 3;
fs_status_desc.bEndpointAddress = hs_status_desc.bEndpointAddress = USB_DIR_IN | 11;
EP_STATUS_NAME = "ep-f";
So far both the sink and source endpoints are working nicely. Here's the only problem: when the host requests the string descriptors, the requests are successfully detected at my device end, and the corresponding string is sent (using the write system call) to endpoint 0, which is the file /dev/gadgetfs/fsl-usb2-udc. However, the host does not receive the strings and times out.
Does anyone have an idea of how I should properly send data through endpoint 0 of the fsl-usb2-udc driver? Thank you!