USB Stack

HI all,

I am having some doubts. I am new to USB devices.

1.Whether USB stack should be implemented for each type of storage device or one single USB stack is enough for all the storage devices.
  1. Whether Drivers for disk controllers are included within the operating system or a controller card or we have to write our own.
  2. What's the difference b/w USB host stack and USB device stack and how they will communicate.
  3. Whether the USB stack will be different for different hardware platform. If so for which I need to search?
  4. Whether USB drivers and USB stack are same


Reply to
Loading thread data ...

??? Basically everything then.


formatting link
formatting link
for answers to life the universe and everything.

Regards, Richard.

formatting link

Reply to

Hi guru,

your questions are a little too unspecific, so I am not sure if I can really help you.

I would strongly encourage you to:

  • go to
    formatting link
    - read the book
  • go to
    formatting link
    - have a look at some sample code
  • go to - have a look at the USB specification - have a look at relevant USB device class specifications
  • go to a chip vendor's site (e.g. Cypress) - have a look at a few data sheets

This should give you a good start into USB.

USB does not only define the basic protocol to exchange bytes between a host and a device, but also so called device classes. There are pre-defined classes for a number of devices. You are probably looking for the mass-storage class. This is a device class defining standard commands for removable media like hard drives, cameras, mp3 players and so on.

drivers for the typical device classes ship with the operating system. That's why you usually don't need to write a driver to access a USB hard drive connected to your system.

USB is an asymmetric protocol. All commands are initiated from the host side. The host handles all the device discovery and enumeration. Therefore the software on the host is much more complex than the software running on a device.

I am assuming you don't care about the host, as you will probably use a standard operating system with built-in USB support.

Talking about devices: You can easily write the device firmware in "C", so that it is portable across different hardware architectures (namely different CPUs and different USB function controllers).

You will probably need to adapt the code in order to support your USB function controller. Typical USB chips (e.g. Cypress) come with tons of sample code that you can start with.

Depends on what your term "USB stack" really refers to. I would tend to define things like this:

- USB stack is the code that discovers and enumerates generic USB devices on the bus

- USB drivers are the code that implements standard device classes and plugs into the associated operating system APIs to implement the functionality. This could be drivers for USB audio or USB storage

Going from this definition: The answer is clearly *no*.

Hope this helps, best regards


Dipl.-Ing. Felix Bertram
Reply to
Felix Bertram

HI Felix,

Thanks a lot!!



Reply to

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.