USB Component  Version 5.1
MDK-Professional Middleware for USB Device and Host
 All Data Structures Functions Variables Enumerations Enumerator Groups Pages
MSC: Mass Storage Class

The Mass Storage Class (HID) is mainly used for devices that allow access to their internal data storage. Typical examples for MSC class devices are:

  • External hard drives (HDD)
  • External optical drives (such as CD or DVD drives)
  • Portable Flash memory devices
  • Solid-state drives (SSD)
  • Digital cameras
  • Card readers
  • Mobile phones

Detailed description about MSC is provided by USB Implementers Forum (USB-IF).

MSC Class Features and Limitations

Not only hard disks use the MSC class. Any device that allows access to its internal data storage using MSC can be connected to the USB Bus as a mass storage device. These are the features and the limitations of the MSC class in the USB Component:

  • Just the bulk-only transport (BOT) protocol is supported. The BOT protocol specifies that not only data is transferred using bulk transfer, but also command and status data. Control transfers via the default pipe send class-specific requests to clear Stall conditions on bulk endpoints.
  • The maximum number of bulk IN and OUT endpoints is limited to 1.
  • The USB Component supports the MSC Class for USB Device and USB Host applications.

Control Transfers

The MSC specification defines five class-specific requests to be transmitted over the default (control) pipe. Only two of them are supported by the bulk-only protocol:

  • The Bulk Only Mass Storage reset request enables the USB Host to reset the MSC device and its associated interface.
  • The Get Max LUN request allows the USB Host determine the number of Logical Units (LUNs) that are supported by the device. LUNs are numbered starting from LUN 0 to LUN 15 (maximum).

Bulk Transfers

The bulk-only protocol divides a successful data transfer into three stages:

  1. Command transport: the USB Host sends a command in the Command Block Wrapper (CBW) structure
  2. Data transport: the data is sent to or from the USB Host
  3. Status transport: the USB Device sends status information in the Command Status Wrapper (CSW) structure

Descriptor Requirements

The following descriptors are required in an USB MSC Device:

  • Standard device descriptor
  • Standard configuration descriptor
  • Standard interface descriptor for the MSC Class
  • Standard endpoint descriptors for Bulk IN and Bulk OUT endpoints
  • Standard string descriptor for unique serial number


The necessary descriptors are automatically generated by the USB Middleware Component. The page Device Descriptor provides more information on the topic.

Note
Further information on how to use MSC is given in the Reference section: MSC: Mass Storage Class Functions