USB Mass Storage Driver
MC9S12UF32 Card Reader Reference Design User Manual, Rev. 0.1
22
Freescale Semiconductor
Figure 6-1. Command Data Status Flow
6.2.1 USB Command Block Wrapper
The host sends each Command Block Wrapper containing a command block to the device via the
Bulk-OUT endpoint. The Command Block is represented by the bits 15 to 30 of the CBW. Our device
supports the sub-class code of 0x06 of the SCSI Transparent Command Set.
Table 6-1. Command Block Wrapper
bit
Byte
7
6
5
4
3
2
21
0
0 — 3
LSB (Byte 0)
MSB (Byte 3)
dCBWSignature
(0x55 0x53 0x42 0x43)
4 — 7
dCBWTag
8 — 11
dCBWDataTransferLength (number of bytes of data transfer expected)
12
bmCBWFlags
13
Reserved (0)
bCBWLUN (logical device number)
14
Reserved (0)
bCBWCBLength (Command Block length)
15 — 30
bCBWCB (Command Block)
READY
HOST SENDS OUT CBW
OUT
DATAx 31 BYTE CBW
HOST SENDS OUT DATA
OUT
DATAx
DATA
IN
DATAx
DATA
DEVICE RETURNS DATA
MORE DATA
TO SEND
?
MORE DATA
TO RECEIVE?
IN
DATAx
13 BYTE CSW
DEVICE RETURNS CSW
YES
NO
YES
NO