USB Mass Storage Class Bulk-Only Transport
MC9S12UF32 Card Reader Reference Design User Manual, Rev. 0.1
Freescale Semiconductor
23
6.2.2 USB Command Status Wrapper
The USB Command Status Wrapper starts on a packet boundary and ends as a short packet with exactly
13 bytes transferred. The bCSWStatus indicates the success or failure of the command. The device will
set this byte to zero if the command is completed successfully, to 1 if it fails and to 2 for phase error. The
host will perform a Reset Recovery when phase error status is returned in the CSW.
6.2.3 SCSI Command Descritpor Block
The SCSI Command Descriptor Block always has an operation code as the first byte and the control byte
as its last byte. For any command, if there is an invalid parameter in the CDB, the target should terminate
the command without altering the medium.
Table 6-2. Command Status Wrapper
7
6
5
4
3
2
21
0
0 — 3
dCSWSignature (0x55 0x53 0x42 0x53)
4 — 7
dCSWTag (get from the CBW)
8 — 11
dCSWDataResidule
(number of bytes different between expected transfer length and actual handled)
12
bmCSWStatus
Table 6-3. CDB of 6-byte Command
7
6
5
4
3
2
21
0
0
Operation Code
1
|
3
dCBWTag
(MSB)
Logical Block Address (if required)
(LSB)
4
Transfer Length (if required)
Parameter List Length (if required)
Allocation Length
5
Control
Table 6-4. CDB of 10-byte Command
7
6
5
4
3
2
21
0
0
Operation Code
1
Reserved (0)
Service Action (if required)
2 — 5
(MSB byte 2)
Logical Block Address (if required)
(LSB byte 5)
6
Reserved (0)
7
|
8
(MSB byte 7)
Transfer Length (if required)
Parameter List Length (if required)
Allocation length (if required)
(LSB byte 8)
9
Control