|mkdir g && cd g|
|echo 0x1d6b > idVendor # Linux Foundation|
|echo 0x0104 > idProduct # Multifunction Composite Gadget|
|echo 0x0100 > bcdDevice # v1.0.0|
|echo 0x0200 > bcdUSB # USB 2.0|
|echo 0xEF > bDeviceClass|
|echo 0x02 > bDeviceSubClass|
|echo 0x01 > bDeviceProtocol|
|mkdir -p strings/0x409|
|echo "deadbeef00115599" > strings/0x409/serialnumber|
|echo "irq5 labs" > strings/0x409/manufacturer|
|echo "Pi Zero Gadget" > strings/0x409/product|
|mkdir -p functions/acm.usb0 # serial|
|mkdir -p functions/rndis.usb0 # network|
|mkdir -p configs/c.1|
|echo 250 > configs/c.1/MaxPower|
|ln -s functions/rndis.usb0 configs/c.1/|
|ln -s functions/acm.usb0 configs/c.1/|
|# OS descriptors|
|echo 1 > os_desc/use|
|echo 0xcd > os_desc/b_vendor_code|
|echo MSFT100 > os_desc/qw_sign|
|echo RNDIS > functions/rndis.usb0/os_desc/interface.rndis/compatible_id|
|echo 5162001 > functions/rndis.usb0/os_desc/interface.rndis/sub_compatible_id|
|ln -s configs/c.1 os_desc|
|udevadm settle -t 5 || :|
|ls /sys/class/udc/ > UDC|
I can't get this to work with a mac, it works fine on Windows and Linux.
No matter what I try I can't seam to find a combination that will work with all Windows/Mac/Linux if I want more than just g_ether (I want a mass_storage to server up a set of tools that talk to the pi via the ethernet connection)
@teafella I've been working on creating a configuration that would work both on Windows and OS X Catalina (and Linux ofc as well). The trick is to create separate configurations for RNDIS and ECM with libcomposite, then link appropriate functions:
This way it works also on OS X
@maxiwoj Did you ever get your composite USB script working?
I've been trying to make a composite device that provides an ACM serial-port, an ECM network interface (for mac/Linux), and an RNDIS interface (for Windows). For some reason, Windows doesn't want to show the ACM interface. I can make the ACM and ECM show up on MacOS just fine, but Windows won't show the ACM if I have more than one config. I haven't figured out why yet. :(
If you have a working example that provides ACM, ECM, and RNDIS (with ACM/RNDIS working on windows and ACM/ECM working on Mac), it could help me out bigtime.
@nrclark I couldn't make Windows recognize RNDIS device in a composite device setup. The only thing I could do was either skip the second device (Mass Storage in my case) on Windows or make it recognize as a composite device but not install appropriate drivers for the RNDIS (a composite device with 2 subdevices is detected, but the required drivers are not installed and devices are not recognized properly).
Since Windows requires a particular pair of IdVendor/idProduct to determine the driver for RNDIS, the configuration of placing RNDIS inside a composite setup might not work without providing a custom INF file stating the information about the devices in the composite setup. However, I haven't confirmed that so If anyone makes it work without the INF file or confirms that it is not possible, I'd be grateful for such information!
I can confirm the sequence described in the original article http://irq5.io/2016/12/22/raspberry-pi-zero-as-multiple-usb-gadgets/ does not work with the current Raspberry PI os, or an even later one linux-rpi-5.4.y I grabbed yesterday (I'm writing this Sept 3 2020).
Individual usb gadget devices work fine, but as soon as I try to have 2, neither one works. I also tried eem instead of th rndis, no improvement.
I'm wondering which version of the pi linux kernel did work, I'll be happy to rollback to that. This is all on a pi zero, btw.
Regarding my previous post, I have a new datapoint. I grabbed an older release
Ok more progress. I've isolated the failure to between two releases:
Unfortunately it seems to be a massive overhaul, just doing diff -Nur on the drivers/usb/gadget directories yields a 544kbyte file with 19,253 lines. My contribution is done now.