Micrium

µC/USB Host Overview

Mass Storage Class

Drivers

Licensing

Pricing Information

µC/USB-Host

µC/USB-Host is a compact, reliable USB host stack. Built to be portable, scalable and robust, µC/USB-Host enables the rapid integration of support for connection of USB devices to your embedded system, thereby minimizing your time to market.

FEATURES and BENEFITS

Cleanest Source Code µC/USB-Host provides you with the highest quality source code in the industry. µC/USB-Host is written in ANSI C enabling its usage with a wide array of best-of-class cross-development tools.
Portable µC/USB-Host can be used on 16, 32 and even some 64-bit CPUs.
Flexible µC/USB-Host supports the dynamic insertion and removal of devices, with automatic device type detection, driver assignment and application notification. Multiple devices and cascaded hubs are supported, so that µC/USB-Host is also suitable for complex applications. Class drivers are provided for several standard classes--including mass storage, HID and CDC--and a flexible USB class driver interface expedites support for new device classes.
Royalty Free µC/USB-Host is licensed on a per-end-product basis. Each different product that embeds µC/USB-Host requires a different license.

ARCHITECTURE

µC/USB-Host employs a modular architecture, with three software layers between the application and hardware:

1. 
Class driver layer. The USB specification divides devices into different classes, subclasses and protocols.  Each class driver in this layer supports devices belonging to certain classes or subclasses. For example, the Mass Storage Class (MSC) driver supports flash drives, hard drives and other compatible USB storage devices. See the class support section below for information about specific class drivers.

2.

Host stack core. The host stack core contains hardware-, CPU-, compiler- and device type-independent code that implements most of the stack functionality. This layer contains three sub-layers: the USB driver, the hub driver and the class device manager.

The USB driver provides the mechanisms which allow the class drivers to transfer data to devices.

The hub driver is a special class driver responsible for hub-type devices. This code monitors the hub ports for device attach or detach events. When the hub driver detects that a device is attached or detached, it uses the USB driver layer to acquire information about the device and match it with its appropriate drivers.

 

The class device manager provides a framework for class drivers. When a new USB device is attached, the class device manager loads the appropriate class driver(s) for that device and notifies any registered application tasks that such a device has been connected. When the device is detached, the class device manager notifies registered application tasks that a device has been removed.

3. 
Host controller driver. The HCD layer communicates with the host controller hardware to transfer data across the USB bus.

In addition to these layers, an RTOS port is used to abstract the RTOS services (such as timers and semaphores) used by the stack and its class drivers. The stack can be used with any RTOS by providing a suitable port.

CLASS SUPPORT

Mass Storage Class (MSC). With this class driver, and a file system, you can access files on a connected USB flash drive, hard drive, DVD drive, etc. For more information, see the mass storage class page.

Human Interface Device (HID) Class. Mouses and keyboards are common examples of HID-compatible devices. Additionally, may specialized HID devices are used in commercial and industrial applications. Example protocol drivers are provided for mouse and keyboard support.

Communications Device Class (CDC). CDC devices, as implied by the name, are typically used for communication. USB-to-Ethernet, WiFi and USB-to-serial dongles typically comply with this class.

Other Standard Classes. Additional class drivers are being developed. Contact us for more information about a particular class driver.

Vendor-specific. A class driver can easily be written for a vendor-specific class.  

MEMORY FOOTPRINT

The following memory footprints were derived for an ARM7 target using IAR's EWARM V4.41A. ROM sizes are shown for ARM mode, with Thumb mode in parentheses. Compiler optimization set for maximum optimization for either size or speed as indicated. µC/USB-Host options set to default values.

For µC/USB-Host, we have excluded the host controller driver and BSP layers since these are host controller- and board-specific.

ROM Size

µC/USB-Host
LAYERS
Compiler
optimized
for Size, kB
[ARM (Thumb)]
Compiler
optimized
for Speed, kB
[ARM (Thumb)]
Core
13.6   (8.9)   
14.2   (9.2)   
OS*
1.3   (0.9)   
1.4   (1.0)   
C Library
3.2   (2.1)   
3.5   (2.3)   
µC/USB-Host Total:
18.0  (11.9)   
19.1  (12.5)   

OS layer for µC/OS-II. OS layers for other RTOSs will be different sizes, but this should be representative.

µC/USB-Host
CLASS DRIVERS
Compiler
optimized
for Size, kB
[ARM (Thumb)]
Compiler
optimized
for Speed, kB
[ARM (Thumb)]
HID Class
6.9   (4.3)   
6.9   (4.3)   
Mass Storage Class (MSC)*
3.9   (2.8)   
3.9   (2.8)   

The mass storage class driver does not include file system software, which is necessary for accessing the files and directories on a connected device. For more information, see the mass storage class page.

RAM Size

µC/USB-Host
Expression
Typical RAM Usage, kB
Base
-----
0.3
Root Hub
-----
0.7

Above this value for the base µC/USB-Host RAM requirement, the requirements depend on the host controller and stack configuration:

1. 
A task is used to handle asynchronous events, such as the connection of devices or completion of asynchronous transfers. The stack for this task is typically around 384 entries (for a 32-bit processor such as an ARM).
2. 
For each device that is connected to the root hub, or to a connected hub, approximately 500 bytes is needed. Most applications will only need one or two connected devices.
3. 
The host controller driver may require a certain amount of RAM for buffers or descriptors. Complete host controller driver memory footprint information is included on the drivers page.

In the following table, we use the following definitions:

sizeof(OS_STK) = 4

This is typical of 32-bit processors.

µC/USB-Host
Expression
Typical RAM Usage, kB
Asynchronous I/O Task Stack sizeof (OS_STK) * USBH_CFG_HCD_ASYNC_THREAD_STK_SIZE
1.5
Device Information 500 bytes * NBR_DEVICES
1.0
Host Controller Driver