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

Can't get USB "Peripheral" Mode to work with Compute Module

Wed Dec 13, 2017 3:16 am

I am using a CM3 with the CMIO 3.0 board. I tried to use the dwc2 driver and g_ether to set the Raspberry Pi as a peripheral device, but it is not recognized by my desktop in any way (e.g. dmesg on the desktop does not change when I plug in the Raspberry Pi).

I'm running Linux rpi 4.9.68-v7. I added dtoverlay=dwc2 to /boot/config.txt and modprobe g_ether returns:

Code: Select all

[   48.432612] using random self ethernet address
[   48.437121] using random host ethernet address
[   48.442320] usb0: HOST MAC 46:2e:b1:85:0b:29
[   48.446757] usb0: MAC 9e:1e:1b:66:2c:7e
[   48.450740] using random self ethernet address
[   48.455236] using random host ethernet address
[   48.459852] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[   48.466538] g_ether gadget: g_ether ready
[   48.470613] dwc2 3f980000.usb: bound driver g_ether
However, when I plug a USB cable into the micro USB port, nothing happens. Any ideas?

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1263
Joined: Sat Sep 10, 2011 11:43 am

Re: Can't get USB "Peripheral" Mode to work with Compute Module

Wed Dec 20, 2017 9:40 am

Are you correctly setting up the OTG_ID pin? Or ignoring the OTG_ID by forcing it into peripheral mode?
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

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

Re: Can't get USB "Peripheral" Mode to work with Compute Module

Thu Dec 21, 2017 5:07 pm

Not sure if it's correct, but I removed resistor R12 and connected USB_OTGID to 3.3V.

I set the USB to "Gadget only mode" in the kernel using the DWC2 mode selection (see attachment).

The strange part is when running as gadget mode, the Raspberry Pi will load the g_ether kernel module just fine, but no ethernet device shows up on ifconfig. When I plug the Compute Module into a comptuer (via the USB slave port), nothing shows up in dmesg.

Maybe the USB Switch (U5) isn't being properly routed to the slave port and routing everything through the USB Host one?
Attachments
Compute Module.png
Compute Module.png (31.58 KiB) Viewed 577 times

Return to “Compute Module”

Who is online

Users browsing this forum: No registered users and 2 guests