Page 1 of 1

Can I use Raspberry Pi model B as slave(gadget) device?

Posted: Fri Aug 19, 2016 7:28 am
by girijapretha
Hi,

I am trying to emulate Raspberry Pi 3 as USB gadget device and connect to linux PC. But I am not able to achieve it.

I found in https://www.element14.com/community/thr ... hread=true that the micro USB port act only as power port and not OTG.
So I want to confirm whether RPI supports OTG and can I make RPI to act as gadget device?
If yes which model does support this functionality?

Re: Can I use Raspberry Pi model B as slave(gadget) device?

Posted: Fri Aug 19, 2016 8:35 am
by fruitoftheloom
girijapretha wrote:Hi,

I am trying to emulate Raspberry Pi 3 as USB gadget device and connect to linux PC. But I am not able to achieve it.

I found in https://www.element14.com/community/thr ... hread=true that the micro USB port act only as power port and not OTG.
So I want to confirm whether RPI supports OTG and can I make RPI to act as gadget device?
If yes which model does support this functionality?
Unfortunately not, but the RPi 3B has other capabilities, which you may find of interest:

https://www.raspberrypi.org/blog/pi-3-b ... orage-boot

https://www.raspberrypi.org/blog/pi-3-b ... he-awesome

Re: Can I use Raspberry Pi model B as slave(gadget) device?

Posted: Fri Aug 19, 2016 8:48 am
by girijapretha
Thanks for your answer :)
I have gone through the link you have shared and it speaks about booting RPI with USB mass storage and Ethernet instead of SD Card. Correct me if I am wrong.

Re: Can I use Raspberry Pi model B as slave(gadget) device?

Posted: Fri Aug 19, 2016 9:24 am
by B.Goode
There seem to be 2 issues here:

The microUSB connector on an RPi3 is for power only. It has no usb functionality of any sort.

Edit: the following was posted in error and should be ignored! There is a blog post from the RPF describing BETA software that allows the conventional (full-size) usb port on an RPi3 to be reconfigured as a Mass Storage Device. If it does not work after following the documentation in the blog post, see the very last line of the blog entry.
It should have said ... "allows the conventional (full-size) usb port on an RPi3 to be reconfigured to boot from a Mass Storage Device." The post is the one to which @fruitoftheloom had already provided a link: your interpretation that this does not meet your needs is correct although you might have benefitted from the information provided.

Allegedly an RPiZero can have its microusb port (but NOT the power connector) reconfigured as a Mass Storage Device.

Edit: apologies for adding uncertainty rather than clarity.

Re: Can I use Raspberry Pi model B as slave(gadget) device?

Posted: Fri Aug 19, 2016 11:26 am
by fruitoftheloom
B.Goode wrote: Allegedly an RPiZero can also have its microusb port (but NOT the power connector) reconfigured as a Mass Storage Device.
Yep a ZERO can be many things a RPi 3B can not, because the 1B / 1B+ / 2B / 3B has a LAN9512/4 USB Hub/ Ethernet Port on the end of the USB BUS, so will answer about the ZERO but it has zero relevance to OP:

http://blog.gbaman.info/?p=699

Re: Can I use Raspberry Pi model B as slave(gadget) device?

Posted: Fri Aug 19, 2016 11:27 am
by fruitoftheloom
B.Goode wrote:There is a blog post from the RPF describing BETA software that allows the conventional (full-size) usb port on an RPi3 to be reconfigured as a Mass Storage Device. If it does not work after following the documentation in the blog post, see the very last line of the blog entry.
Yes I provided the links in my response :shock: :shock:

Re: Can I use Raspberry Pi model B as slave(gadget) device?

Posted: Fri Aug 19, 2016 11:28 am
by fruitoftheloom
girijapretha wrote:Thanks for your answer :)
I have gone through the link you have shared and it speaks about booting RPI with USB mass storage and Ethernet instead of SD Card. Correct me if I am wrong.
Yes you are reading the Blog correctly, but it is still in BETA Status ;)

Re: Can I use Raspberry Pi model B as slave(gadget) device?

Posted: Fri Aug 19, 2016 11:49 am
by B.Goode
fruitoftheloom wrote:
B.Goode wrote:There is a blog post from the RPF describing BETA software that allows the conventional (full-size) usb port on an RPi3 to be reconfigured as a Mass Storage Device. If it does not work after following the documentation in the blog post, see the very last line of the blog entry.
Yes I provided the links in my response :shock: :shock:
Quite so. I was being ironic/sarcastic and attempting to suggest that the questioner should read the information that had been placed in front of them.

Let's not fall out...

Re: Can I use Raspberry Pi model B as slave(gadget) device?

Posted: Fri Aug 19, 2016 12:01 pm
by mikerr
B.Goode wrote:There is a blog post from the RPF describing BETA software that allows the conventional (full-size) usb port on an RPi3 to be reconfigured as a Mass Storage Device.
For clarity, no the RPi3 CANNOT be "configured as a mass storage device"
- the rpi3 can only BOOT from USB /ethernet with that beta software.


The only pi models that can be a slave gadget device (mass storage device) are those without the usb hub chip:
Pi Zero, A+ and compute module

Re: Can I use Raspberry Pi model B as slave(gadget) device?

Posted: Fri Aug 19, 2016 12:07 pm
by B.Goode
mikerr wrote:
B.Goode wrote:There is a blog post from the RPF describing BETA software that allows the conventional (full-size) usb port on an RPi3 to be reconfigured as a Mass Storage Device.
For clarity, no the RPi3 CANNOT be "configured as a mass storage device"
- the rpi3 can only BOOT from USB /ethernet with that beta software.


The only pi models that can be a slave gadget device (mass storage device) are those without the usb hub chip:
Pi Zero, A+ and compute module
Oops! Clang!

Absolutely right. Thanks Mike, and apologies to FoL. I'll edit my contribution with a retraction.

Re: Can I use Raspberry Pi model B as slave(gadget) device?

Posted: Fri Aug 19, 2016 12:14 pm
by fruitoftheloom
mikerr wrote:
B.Goode wrote:There is a blog post from the RPF describing BETA software that allows the conventional (full-size) usb port on an RPi3 to be reconfigured as a Mass Storage Device.
For clarity, no the RPi3 CANNOT be "configured as a mass storage device"
- the rpi3 can only BOOT from USB /ethernet with that beta software.


The only pi models that can be a slave gadget device (mass storage device) are those without the usb hub chip:
Pi Zero, A+ and compute module
You forget the RPi 1A !!

It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.


http://blog.gbaman.info/?p=699

Re: Can I use Raspberry Pi model B as slave(gadget) device?

Posted: Tue Sep 13, 2016 10:15 am
by E3V3A
@fruitoftheloom
Yep a ZERO can be many things a RPi 3B can not, because the 1B / 1B+ / 2B / 3B has a LAN9512/4 USB Hub/ Ethernet Port on the end of the USB BUS,
Assuming an RP3-B:
If one is not using any of those USB HUB endpoint devices (Ethernet etc), I'd guess it would be possible to cut and pull the original USB_ID line to provide a OTG function? Where are the schematics showing how this is actually wired?

Re: Can I use Raspberry Pi model B as slave(gadget) device?

Posted: Tue Sep 13, 2016 7:59 pm
by rpdom
E3V3A wrote:Assuming an RP3-B:
If one is not using any of those USB HUB endpoint devices (Ethernet etc), I'd guess it would be possible to cut and pull the original USB_ID line to provide a OTG function? Where are the schematics showing how this is actually wired?
The schematics for the USB data and OTG lines will be similar, if not identical, to that of the original Pi A/B ones.

The OTG USB_ID line is grounded close to the chip, which means you can't get normal OTG function without hardcoding it (as has been used on the A and A+ models).

Re: Can I use Raspberry Pi model B as slave(gadget) device?

Posted: Wed Sep 14, 2016 3:05 pm
by E3V3A
rpdom wrote:The schematics for the USB data and OTG lines will be similar, if not identical, to that of the original Pi A/B ones. The OTG USB_ID line is grounded close to the chip, which means you can't get normal OTG function without hardcoding it (as has been used on the A and A+ models).
Great! So looking at the schematics (page 3) from the other models and assuming (since we don't have the proper ones for the RP3B) that the connections to the LAN9514 are similar to what is shown, then we should be able to cut the USB_OTGID`(K16) and patch it out to a switch, while either (a) shutting down the LAN9512 completely or (b) cut-patching out USB_DP/M0 (IC3:58,59). Then we see that we have direct USB connection to IC2.

Image