mrvn
Posts: 58
Joined: Wed Jan 09, 2013 6:50 pm

Re: Implementing a USB Driver

Mon Jan 21, 2013 7:01 pm

You know what's missing from this thread?

An url for the latest driver (from Gordon who has the specs).

Mrvn

whitebluff
Posts: 4
Joined: Wed Mar 06, 2013 9:56 pm

Re: Implementing a USB Driver

Wed Mar 06, 2013 10:31 pm

Can we use that micro-usb port as the device mode usb? Where can I find device mode usb document?

ghans
Posts: 7878
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Implementing a USB Driver

Thu Mar 07, 2013 9:37 am

Nope , you might be able to use the Type A Socket on the Model
A for it though.
Don't ask me how Linux handles device mode !

ghan
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

whitebluff
Posts: 4
Joined: Wed Mar 06, 2013 9:56 pm

Re: Implementing a USB Driver

Thu Mar 07, 2013 5:45 pm

i found a freebsd usb driver for this IP

ghans
Posts: 7878
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Implementing a USB Driver

Thu Mar 07, 2013 6:10 pm

Yes , Plan9 has one too AFAIK.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

whitebluff
Posts: 4
Joined: Wed Mar 06, 2013 9:56 pm

Re: Implementing a USB Driver

Mon Mar 11, 2013 11:10 pm

I just noticed the microUSB doesn't have D+/D- pins connected, and the other two usb ports are connected to a usb hub LAN9512. Can I disable LAN9512 and set usb module of BCM2835 to device mode? (through OTG). I have a usb device mode driver ready, and want to test it on raspberry.

ghans
Posts: 7878
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Implementing a USB Driver

Tue Mar 12, 2013 12:21 pm

I think this is only possible on Model A.
Doesn't device mode need a direct conmection to the SoC ?
And AFAIK OTG needs a special plug and an additional pin ,
which are not routed at all on the B and A boards.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

cyanarnofsky
Posts: 70
Joined: Tue Jul 31, 2012 11:33 pm

Re: Implementing a USB Driver

Fri Mar 28, 2014 5:31 pm

I am rather noob but was curious if anyone here could help me with a question:

Is it possible on the Rasp Pi to disable/re enable USB Host Driver to reset all USB devices without
power cycle?

hartnett
Posts: 15
Joined: Fri Mar 01, 2013 9:00 pm

Re: Implementing a USB Driver

Wed Apr 09, 2014 9:32 pm

I have been messing around with the RPi DWC USB driver(s) - off and on - for a while now. This is a BARE METAL endeavor.. my "OS" just uses UART and TIMER interrupts. All my console I/O is to the UART. I'm running "them" (see below) on both the model A and model B RPi (and, if you're not familiar with it, the A model does NOT have the on-board LAN9512 hub).

I have three "versions" of the USB driver working (again, more or less). I'm trying to do a bit of "poor man's" networking between the RPi (as a host) and several other MCUs (principally the Netduino (Atmel SAM7X512) and the mini-box picoSAM9G45 (Atmel SAM9G45)), as well as some HUBs and USB Mass Storage Devices (MSDs), as downstream devices. I'm not (yet?) all that interested in supporting HIDs (but that may change). I really need the driver(s) to support enumeration and exchanging control and bulk messages.

The versions are:

(1) The U-Boot (for RPi) DWC/HCD driver (which is derived from the Linux DWC driver),
(2) The CSUD driver. (Thanks Alex!), and
(3) The "Embedded Xinu" driver.

Each version has good and bad points. The (1) U-Boot version (without the model B's on-board hub) does not support full- and low-speed devices. And it seems to be (unfortunately and, in MY experience (yours may differ)) very fragile. Very few failures are recoverable.

The (2) CSUD version is simple and clean. But I'm "not there yet." I'm able to enumerate most anything, but it presently only handles control messages and I'm in the middle of implementing a bulk message handler.

But the (3) "Embedded Xinu" (just google it) version is really noteworthy for two reasons. First, few people even know it exists. But second, and more important, they've really done a stand-up job documenting both what they were able to glean from "other sources" (principally the Linux driver) and THEIR EXPERIENCE as to which bits matter (and which DON'T). It's REALLY worth looking at (if for no other reason than to read the comments). The "downside" (again, MY opinion) is that it uses a handful of "Xinu constructs" (semaphores, mailboxes, threads, etc.) that MOST of us are familiar with in the abstract, but FEW of us have significant experience with Xinu. And the Xinu driver is actually interrupt-driven, NOT just polling the Host_Channel_Interrupt register (5x0+8). They've also "dotted a lot of i's and crossed a lot of t's." For example, their driver not only knows how to power UP the DWC (through the GPU's mailboxes).. but it also knows how to power DOWN (and stop, and deinitialize) the DWC and HCD.

Regards,

Tom

metalalive
Posts: 3
Joined: Wed Dec 06, 2017 4:28 pm
Location: Taipei

Re: Implementing a USB Driver

Wed May 23, 2018 12:53 pm

mark_3094 wrote:
Mon Jan 07, 2013 5:35 am
tritonium wrote:Well I too can find nothing to read - the link shows an empty box???
Here is the direct link:
http://networkdirection.net/images/stor ... 0v1.02.pdf

Does that work for you? If not, let me know and I will contact the hosting people.
excuse me, I'm new to USB programming stuff
and have been trying to write bare-metal application, bring up USB camera device on my RPi ,
but missed out on the link ,

I've googled then found USPi, tried it on my program for 2 weeks,
but failed to integrate USPi into my bare-metal environment,
might be something going wrong ,
, without any document & hints,
I would have to spend great amount of time digging USPi (also complicated Linux kernel).
that's why I ask the question, to see if anyone cracking the USB driver on RPi can give some hints to me .

could somebody kindly share the document again ?
really appreciate the work .
Last edited by metalalive on Wed May 23, 2018 4:42 pm, edited 2 times in total.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24201
Joined: Sat Jul 30, 2011 7:41 pm

Re: Implementing a USB Driver

Wed May 23, 2018 12:57 pm

metalalive wrote:
Wed May 23, 2018 12:53 pm
mark_3094 wrote:
Mon Jan 07, 2013 5:35 am
tritonium wrote:Well I too can find nothing to read - the link shows an empty box???
Here is the direct link:
http://networkdirection.net/images/stor ... 0v1.02.pdf

Does that work for you? If not, let me know and I will contact the hosting people.
excuse me, I'm new to USB programming stuff
and have been trying to write bare-metal application, bring up USB-to-TTL device on my RPi ,
but miss out on the link ,
could somebody kindly share the document again ?
really appreciate the work .
You have added to a 4 year old thread, it's quite possible that the people involved will never see the posting. Not sure what to suggest, except extensive Google use.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

LdB
Posts: 1329
Joined: Wed Dec 07, 2016 2:29 pm

Re: Implementing a USB Driver

Wed May 23, 2018 5:55 pm

metalalive wrote:
Wed May 23, 2018 12:53 pm
I would have to spend great amount of time digging USPi (also complicated Linux kernel).
that's why I ask the question, to see if anyone cracking the USB driver on RPi can give some hints to me .
I don't have the document

however rst has USPI on his github site
https://github.com/rsta2/uspi

I also did a redux of Chadderz's Simple USB Driver to about the most basic you can do.
If you want to try it put the files in DiskImg on this github directory onto a blank SD card and tell me if it enumerates the USB camera (that is you can see it in the list)
https://github.com/LdB-ECM/Raspberry-Pi ... m32_64_USB

So long as the camera enumerates on either system and you can give us details of the camera it's probably not hard to help you open the pipe to bulk endpoint on the camera.

if all that works I would strongly suggest you pickup Sergiy Bogdancev series about "Getting video stream from USB web-camera on Arduino" from here (its an 8 part series you are starting at part5)
https://www.codeproject.com/Articles/89 ... ra-on-Ardu
It takes you thru all the basic steps and what you are expecting to come out thru the USB pipe we have already done the early parts for you and enumerated the device (assuming it worked).

Return to “Bare metal, Assembly language”