3

I have a Raspberry Pi 3 (Model B) that I would like to act as a USB gadget or OTG peripheral. Some sources state (without proof) that the USB_ID line is not connected properly, to allow any software hacks to enable OTG behavior.

  1. I would like to to see the schematics proving this.
  2. Since there are 4 USB ports on the RP3B it might be possible to make a hardware hack to allow untying one of the ports and use it for OTG.
  3. Perhaps it's possible to use USB OTG over GPIO?

The only answer touching this subject was this, but is both outdated and doesn't mention any specific model.

  • 3) you can use a usb-serial interface to connect to GPIO. What is the overall goal of the project? – Gotschi Sep 13 '16 at 9:55
5

The usb on the raspberry pi is not connected to the main cpu, it is connected to a usb hub. USB hubs are slave devices to the main cpu and cannot reverse this behaviour. OTG is basically a direct connection to the cpu which can act as either a master or slave device.

USB is a high speed protocol, it requires specific hardware to meet the required timings involved. This hardware is used by the usb HUB and not exposed over the GPIO pins.

If you are allowed extra hardware you can use a microcontroller that can act as a usb slave device and connect it to the pi over serial, i2c or spi. Some possible boards you can use for this are the arduino leonardo (or any based off the atmega32u4 chip set) or the teensy. Depending on what you want to achieve the programming of these might be simple to very advanced depending on if there already exists a library that does what you want. If it is a simple dumb connection you need you can use a usb to UART adaptor.

If you are not fixed on the pi 3 you can use the pi zero, which does not have the usb hub and instead exposes the usb OTG directly.

  • Not exactly what I was looking for, but thanks for the answer. – not2qubit Oct 22 '16 at 1:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.