没有合适的资源?快使用搜索试试~ 我知道了~
首页Mass Storage Class – Bulk-Only Transport
Mass Storage Class – Bulk-Only Transport

非常详细地描述了USB的BBB链接过程。是英文的,由Shakthi Kannan著,2007
资源详情
资源评论
资源推荐

USB Simply Buffered (USB)
Mass Storage Class – Bulk-Only Transport
Copyright © 2007. Shakthi Kannan.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version
1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.
Environment
● Debian Etch 4.0.
● x86 system.
● Sandisk Cruzer Mini 256 MB USB thumb drive.
The mass storage devices that comply with USB Mass Storage Class Specifications are supported by the USB Mass Storage Class Working
Group. The various specifications are:
● USB Mass Storage Class Control/Bulk/Interrupt (CBI) Transport
● USB Mass Storage Class Bulk-Only Transport
● USB Mass Storage Class UFI Command Specification
● USB Mass Storage Class Bootability Specification
● USB Mass Storage Class Compliance Test Specification
Most mass-storage devices follow the Bulk-Only Transport specification. This specification is available in usbmassbulk_10.pdf. Reading
“USB Simply Buffered – Device Enumeration” is a pre-requisite for this documentation.
There is a Command/Data/Status protocol that is followed:
● Command Block Wrapper (CBW)
● Data Transfer (IN/OUT)
● Command Status Wrapper (CSW)

SCSI Primary Commands -2 (SPC-2) specification, and SCSI Block Commands – 2 (SBC-2) commands are used by USB, and follow SCSI
emulation for communication with the device for mass storage devices. The data transfer phase is optional if the host and device decide
not to have one.
So, the commonly used commands are:
● GetMaxLun
● INQUIRY
● TEST UNIT READY
● READ CAPACITY
● MODE SENSE
● REQUEST SENSE
● READ
● WRITE
The Sandisk USB thumb drive was connected to a GNU/Linux host PC, and it got automounted. A small file was copied to the disk, and
finally unmounted.
The commands can be issued anytime when the device is in configured state.
The packet details on the transactions for each of the requests/commands are explained in detail:

1. GetMaxLun
GetMaxLun request consists of the following transactions:
● SETUP transaction (->)
● IN transaction (<-)
● OUT transaction (->)
Host Device
SETUP transaction
IN transaction
OUT transaction
S
ET
U
P
D
A
T
A
0
A
CK
I
N
D
A
T
A
1
A
CK
O
U
T
D
A
T
A
1
A
CK

1.1 SETUP transaction
The SETUP transaction has the following three packets:
● SETUP packet (->)
● DATA0 packet (->)
● ACK packet (<-)
Host Device
S
ET
U
P
D
A
T
A
0
A
CK

1.1.1 SETUP packet
A SETUP packet consists of:
L M L M L M L M
PID !PID Function Address Endpoint CRC
(bits) 4 4 7 4 5
Values:
L M L M L M L M
1011 0100 1100 000 0000 01010
(bits) 4 4 7 4 5
USB is little-endian. LSB goes out of the wire, first.
Displaying from MSB to LSB:
M L
01010 0000 000 0011 0010 1101
Regrouping in groups of 4-bits:
M L
0101 0000 0000 0011 0010 1101
Hex values:
M L
5 0 0 3 2 D
剩余161页未读,继续阅读
















安全验证
文档复制为VIP权益,开通VIP直接复制

评论5