Pi zero usb otg - pi as usb device

General discussion about anything related to Ultibo.
mark
Posts: 1325
Joined: Mon Oct 03, 2016 2:12 am
Location: Indianapolis, US

Pi zero usb otg - pi as usb device

Postby mark » Mon Oct 03, 2016 3:47 am

(Only the pi zero permits pi as usb device - the others can only do host.)
(otg means on-the-go, essentially a usb device mode instead of a host mode.)

It seems that it is very easy to configure raspbian/pi as a usb device, see
https://gist.github.com/gbaman/975e2db1 ... e45e8fd40a

This makes the pi appear as an ethernet over usb device.

How might I pursue this under ultibo?

Thanks, Mark
mark
Posts: 1325
Joined: Mon Oct 03, 2016 2:12 am
Location: Indianapolis, US

Re: Pi zero usb otg - pi as usb device

Postby mark » Mon Oct 03, 2016 3:50 am

User avatar
Ultibo
Site Admin
Posts: 2217
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: Pi zero usb otg - pi as usb device

Postby Ultibo » Mon Oct 03, 2016 11:02 am

Hi Mark,

mark wrote:How might I pursue this under ultibo?

The trick with the USB controller in the Raspberry Pi (any model) is that it has always been almost completely undocumented and so any information has had to be learned from the Linux drivers or other very patchy sources. In the past 6 or so months (less than 12 months) the Linux driver has finally been updated to support OTG mode and so it is finally possible to work out (from studying) how this is done for the DWC controller.

With a working example to look at it is now simply a case of time for someone to work out the necessary software behavior to make OTG work in Ultibo. If anyone is keen for a challenge!
Ultibo.org | Make something amazing
https://ultibo.org
mark
Posts: 1325
Joined: Mon Oct 03, 2016 2:12 am
Location: Indianapolis, US

Re: Pi zero usb otg - pi as usb device

Postby mark » Mon Oct 31, 2016 9:55 am

Update - I've split my project into two separate solutions, one is a usb host and the other is a usb device. I'm working on the host project proof of concept for this week. I will get back to the device mode after that. Mark.
mark
Posts: 1325
Joined: Mon Oct 03, 2016 2:12 am
Location: Indianapolis, US

Re: Pi zero usb otg - pi as usb device

Postby mark » Sat Apr 21, 2018 10:28 am

Garry,

dwcotg.pas has this note: Linux DWCOTG driver - \drivers\usb\host\dwc_otg\*

I want to look at \drivers\usb\gadget

What linux repo do you use to look at things like this?

Thanks,
Mark
User avatar
Ultibo
Site Admin
Posts: 2217
Joined: Sat Dec 19, 2015 3:49 am
Location: Australia

Re: Pi zero usb otg - pi as usb device

Postby Ultibo » Sun Apr 22, 2018 12:31 am

mark wrote:I want to look at \drivers\usb\gadget

What linux repo do you use to look at things like this?

At present we normally refer to the Raspberry Pi linux repo because it contains the most relevant code for our purpose. In the past year or so it has grown much closer to the upstream release so you could really look at them as well.
Ultibo.org | Make something amazing
https://ultibo.org
mark
Posts: 1325
Joined: Mon Oct 03, 2016 2:12 am
Location: Indianapolis, US

Re: Pi zero usb otg - pi as usb device

Postby mark » Sat May 26, 2018 12:21 am

Ultibo wrote:
mark wrote:I want to look at \drivers\usb\gadget

What linux repo do you use to look at things like this?

At present we normally refer to the Raspberry Pi linux repo because it contains the most relevant code for our purpose. In the past year or so it has grown much closer to the upstream release so you could really look at them as well.

One thing led to another and I discovered using rpiboot to start ultibo on a zero will leave the zero enumerated with the usb host. I then discovered that running rpiboot while in this state will cause usb device register b10 to change. I use this to signal ultibo to restart and then the pi will accept another set of boot files over usb. I am using start_cd.elf to speed up the boot process. Simply run ./test.sh on raspbian with a zero attached to usb and with the zero attached to a tv.

https://github.com/markfirmware/ultibo-dev

I am exploring further to see if I can send something over usb to ultibo.

Mark
Gavinmc42
Posts: 1595
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Pi zero usb otg - pi as usb device

Postby Gavinmc42 » Fri Mar 08, 2019 3:12 am

Just noticed some new updates for dwc-otg in kernel 4.19
https://github.com/raspberrypi/linux/tr ... usb/gadget
Any use?
Clues to gadget mode?
Is that a MSD driver?
Gavinmc42
Posts: 1595
Joined: Sun Jun 05, 2016 12:38 pm
Location: Brisbane, Australia

Re: Pi zero usb otg - pi as usb device

Postby Gavinmc42 » Tue Mar 26, 2019 11:54 am

A good chance of telling Grandma to suck eggs but...
I found AROS today and there is port to Pi's in the works.

Some info on USB OTG that I had not seen before, any use?
https://en.wikibooks.org/wiki/Aros/Plat ... Pi_support

Free Pascal has been ported to AROS.
I am pushing learning hard with Raspbian and Gentoo64 but they are Linux and not easy to grok.
Ultibo development on AROS on a Pi3B+?

AROS on a Zero might be fast?
Anyway need to learn about OS's so I can do more on my Steam Punk OS.

Return to “Discussion”

Who is online

Users browsing this forum: No registered users and 0 guests