Isochronous iMX6 USB gadget example

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Isochronous iMX6 USB gadget example

3,186 Views
bertriksikken
Contributor I

I'm looking to implement a USB gadget using Linux on iMX6, that implements an isochronous IN endpoint.

I've started with the usb.c example from http://www.linux-usb.org/gadget/usb.c and modifying it for the iMX6.

I'm using Linux 4.1.15 at the moment. I'm mounting the gadgetfs framework using:

modprobe gadgetfs

mkdir /dev/gadget

mount -t gadgetfs none /dev/gadget

This results in a 2184000.usb file in the /dev/gadget directory.

I've modified the usb.c example to look for this 2184000.usb file and fill a set of USB descriptors. This results in the host computer indeed recognizing the iMX6 as a USB device with the USB descriptors I configured. However I'm getting a bit stuck, the gadget application on the iMX6 seems to hang, eventually resulting in a reboot of my iMX6 Linux platform.

Has anyone done something similar and have source code I could use as inspiration/example?

Labels (2)
3 Replies

1,556 Views
arunkumarsn
Contributor I

Hi Betrik,

Were you able to find a solution for this. We are stuck with the same issue in our board. any leads would be helpful.

Thanks,

Arun

0 Kudos

1,556 Views
bertriksikken
Contributor I

Thanks Igor.

I'm not sure if the links contain source code that I can use to diagnose my problem. I'd like to write my own USB function, not try to use one of the existing ones. Still trying to modify the http://www.linux-usb.org/gadget/usb.c source code example, but I'm almost ready to give up and may need to reconsider my approach.

I found one thing that makes a difference: whether I specify only full-speed endpoint descriptors (I get a couple of complaints from the kernel about missing HS configuration), or both full-speed and high-speed endpoint descriptors (in which case the iMX6 Linux platform hangs and eventually reboots). I haven't gotten to the point that the host OS selects a USB configuration yet.

I'm a bit surprised that apparently I can make the Linux kernel hang/reboot from a user-space application so easily.

I'm starting to suspect bugs in either the UDC driver, gadget usb.c example (which is full of FIXMEs ...) or both. Perhaps my next step is to try a more modern kernel (currently at 4.1.15)

0 Kudos

1,556 Views
igorpadykov
NXP Employee
NXP Employee

Hi Bertrik

supported usb gadgets may be found in attached Linux Manual sect.39.2 Introduction,
for isochronous USB gadget it may be useful to check examples on
https://developer.ridgerun.com/wiki/index.php?title=USB_Video_Class_Gadget_Library_-_libguvc
https://sourceforge.net/p/linux-uvc/mailman/linux-uvc-devel/thread/9D96EB5F79FA2E4A8F813B1A57DE31068...man/linux-uvc-devel/thread/9D96EB5F79FA2E4A8F813B1A57DE31068F1CA5@039-SN2MPN1-013.039d.mgd.msft.net/

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------