Simple USB Host Stack

I am trying to connect to a single USB device using the USB host port on an Atmel processor. I have an embedded system with limited memory and no OS. I want to implement a simple dedicated host to interact with one USB slave.

Can someone lead me to a simple USB host implementation?

The processor is the Atmel AT91SAM9261S.

+7
c ++ c embedded usb
source share
3 answers

First of all, if I remember correctly that the AT91SAM9261S has an OHCI usb controller on board, and you need to implement at least a simple host controller driver (you can take a look at the Linux implementation). Depending on the type of transfer your device will use, it may not be very difficult - very difficult :) There is a trivial way to implement the usb stack. After implementing the controller driver, you will need to take care of listing the usb device, see Chapter 9 USB Specification . And only after that you can begin to implement your device logic.

For a simplified use case, there is a lot of code that can be omitted, but without a good usb background, it's hard to decide what is relevant and what is not.

In any case, if you are looking for a commercial solution, my company can provide it.

+1
source share

I used the RTUSB-32 stack from On-Time. This is a small stop-stop that is easy to integrate into our environment and the documentation is good. They perfectly illuminate the necessary support, so that it is completely neutral to the platform and the OS and has a relatively small number of hooks that you need to provide, that is: it is well encapsulated.

Since you get all the source code, you will see that the code is not the most well-designed code in the world, of course, but it can be decoded without much work if necessary. In any case, it basically "just works" without problems. We have been working in some products for several years now and are faced with only one stack compatibility problem, where it doesn’t quite automatically detect using a certain type of USB 2.0 hub. We sent them a sample of the hub, and within a few days they had a patch. It's hard to beat it. In general, I believe that this is a good value and, of course, beats, sitting down to write a thing from scratch.

+1
source share

It would be much simpler if your device does not need to be a host: -P, because Atmel provides sample source code for USB devices. If I were you, I would consider using one of the USB-loving RTOSs on the page of a third-party Atmel AT91SAM , which could entail a jungo USB drive, as Ilya suggested.

If you are writing your own OHCI driver, libusb can be useful as an implementation of the upper levels of the USB stack.

0
source share

All Articles