AlexisAtWork
Posts: 2
Joined: Wed Feb 01, 2017 4:54 pm

CM3 and usb gadgets (DWC2)

Wed Feb 01, 2017 5:14 pm

Hi,
I've got a Compute module 3 that I'm trying to get going as a USB gadget. Right now, I have the kernel build, the modules load, tons of debug information spitting out, but my computer doesn't see any devices (right now set for CDC_ACM) I have a hunch I am missing something small that I overlooked. I think the problem boils down to these lines in the syslog:

Nov 25 18:17:09 raspberrypi kernel: [ 0.631633] dwc2 3f980000.usb: complete: ep b9bd6810 ep0, req b9be5f40, -104 => 803fb3a0
Nov 25 18:17:09 raspberrypi kernel: [ 0.631648] dwc2 3f980000.usb: dwc2_hsotg_complete_setup: failed -104


shortly after that, it suspends it. am I missing a jumper or something?

Edit: pastbin link of full syslog: http://pastebin.com/ZXjQDL5r
Last edited by AlexisAtWork on Wed Feb 01, 2017 6:25 pm, edited 1 time in total.

gregeric
Posts: 1495
Joined: Mon Nov 28, 2011 10:08 am

Re: CM3 and usb gadgets (DWC2)

Wed Feb 01, 2017 6:24 pm

There's a resistor on the CMIO pulling USB_OTGID low (forcing host mode). Have you installed a jumper cable from USB_OTGID to 3V3, so as to switch to gadget mode?

AlexisAtWork
Posts: 2
Joined: Wed Feb 01, 2017 4:54 pm

Re: CM3 and usb gadgets (DWC2)

Wed Feb 01, 2017 6:28 pm

That's exactly what I missed. Thanks!

sp01109
Posts: 3
Joined: Fri Mar 31, 2017 4:17 am

Re: CM3 and usb gadgets (DWC2)

Fri Mar 31, 2017 4:37 am

AlexisAtWork wrote:That's exactly what I missed. Thanks!
Hi Alexis,

I am recently trying to use USB gadgets and set it as g_ether on CM3. I follow the way how people do on Pi Zero which has following steps:
  • 1. add dtoverlay=dwc2 into /boot/config.txt file
    2. add dwc2 g_ether into /etc/modules
    3. jump USB_OTGID pin to 3V3 on CMIO board as Gregeric mentioned
However, I still cannot make it work. Am I missing something?
Could you share the magic you performed on CM3 to make USB gadgets work?

Thanks a lot!

Raspiator
Posts: 4
Joined: Thu Nov 17, 2016 6:37 pm

Re: CM3 and usb gadgets (DWC2)

Thu Dec 21, 2017 7:37 am

I flash my "compute modul 3, Version V1.0 2015" with the image "raspbian strech lite". I do update and upgrade and it runs perfectly. Then I add the line "dtoverlay=dwc2" to "config.txt", and by doing so and reboot, the host connection is gone, the USB keyboard does no longer work. Even if I add dwc2 and g_ether in /etc/momdules there is no USB g_ether, the modul is in no way reachable (I have to start the bootloader and remove the "dtoverlay=dwc2" line in the config.txt file, then I can access again the CM3 via USB keyboard).

(I know about the OTG USB jumper...)

I dont have this when I flash the compute modul 1 with the same OS "raspbian stretch lite", there I can establish the g_ether usb.

Question 1: Is there anybody having the same trouble with CM3?
Question 2: Any idea, do I miss something else?

TurquoiseBlue
Posts: 3
Joined: Wed Dec 13, 2017 3:05 am

Re: CM3 and usb gadgets (DWC2)

Mon Dec 25, 2017 3:28 am

I've had the same problem -- I haven't been able to get the g_ether to work. I've recompiled and use Raspbian to no avail. Perhaps an old version of Raspbian might work? I haven't tested this yet, though.

And regarding the USB Keyboard -- IIRC the Compute Module can't be both a gadget *and* a host, since it only has one USB interface. So, keyboards/mice won't really work in gadget mode. (I just use a TTL <--> USB cable to connect to my compute module when trying to get DWC2 to work).

Raspiator
Posts: 4
Joined: Thu Nov 17, 2016 6:37 pm

Re: CM3 and usb gadgets (DWC2)

Tue Jan 02, 2018 3:05 pm

Agreed, device and host the same time can not work. There is this silicon switch on the "motherboard", it multiplexes the host and device mode according to the detected VBUS (of the host notebook) when plugging the notebook.

But with CM1: The moment I unplugged the CM1 in device mode from my notebook (with the USB keyboard still connected), with no further change the keyboard was detected by Linux and made available again, and when I reconnect my notebook, the CM1 was recognized as a device again though because of the USB multiplexer the keyboard was gone of course.

For me there is a different behavior between the CM1 and CM3, when doing the same steps as described in my first post. And this behavior for me is crucial, because not only the USB gadget does not work, even the "normal" USB host connector is broken somehow when adding dwc2 in the config.txt .. :?

I wonder how people were able to launch the USB in device mode at all, maybe something on my CM3 is broken...

Return to “Compute Module”

Who is online

Users browsing this forum: No registered users and 5 guests