RPi Zero Gadget Support

For most OTG supported ports, it depends on what you plug into it that decides if the port is in host mode or gadget mode. We just need to get confirmation that the RPi zero port is wired the same way for the port that has it’s usb data pins connected (not the one dedicated to power).

“A device with a micro-A plug inserted becomes an OTG A-device, and a device with a micro-B plug inserted becomes a B-device. The type of plug inserted is detected by the state of the pin ID .”

The RPi zero USB_OTGID pin should be grounded by the cable when using a micro-A / OTG cable and is hopefully left floating otherwise. That way we can the more common micro-B cable for providing power and connecting the usb data pins to a computer.

Here is a RPi zero mechanical diagram, that shows the two usb micro ports for the RPi zero in bottom right:

I couldn’t find wiring schematics for RPi zero, so I pulled these from the RPi A

This is the usb micro port used for power: (no data pins)

This is the RPi-A USB-A port (note that the USB_OTGID pin on the usb controller is grounded). On the RPi zero, this connector is a micro-b port, and shouldn’t have the USB_OTGID pin grounded, as that is usually done by the cable to distinguish between OTG/Host mode and usb gadget mode.

I suspect that if we connect a normal usb A to Micro-B cable that doesn’t ground out the USB_OTGID pin on the RPi zero, that we can accomplish the correct physical connections without any modifications, but we may need the kernel changes mentioned in this comment on #881

Having a $5 usb gadget that could function as a combination of anything in https://github.com/torvalds/linux/tree/master/drivers/usb/gadget/function would be pretty grand.

I’ve opened a ticket for PRi linux kernel to discuss this.