SH7286 Group
USB Function Module: USB Mass Storage Class
R01AN0063EJ0100 Rev. 1.00
Page 7 of 32
Oct. 22, 2010
•
dCBWSignature:
Signature that helps identify this data packet as a CBW. The signature field shall contain the value H'43425355
(little endian).
•
dCBWTag:
A Command Block Tag sent by the host. The dCSWTag is specified by the host, and it associates a CSW with the
corresponding CBW.
•
dCBWDataTransferLength:
The number of bytes of data that the host expects to transfer on the data transport. If this field is zero, the data
transport does not exist.
•
bmCBWFlags:
When bit 7 of this field is 0, data is transferred (data transport) via the bulk-OUT transfer, from the host to the
function. When bit 7 is 1, data is transferred via the bulk-IN transfer, from the function to the host. Bits 6 to 0 are
fixed to 0.
•
bCBWLUN:
The device Logical Unit Number (LUN) to which the command block is being sent.
•
bCBWCBLength:
The valid length of the CBWCB in bytes.
•
CBWCB:
The command block to be executed by the function. The CBWCB stores the command that the host computer
expects to execute (SCSI commands in this sample program).
3.3.2 Status
Transport
In status transport, the function sends the status of the execution of the command block to the host computer via bulk-IN
transfer. The status packet is defined as the Command Status Wrapper (CSW). Bulk-Only Transport always ends with
the CSW. The function sends the CSW with a 13-byte packet via the Bulk-IN transfer. The format of the CSW is listed
in Table 4.
Table 4 Status Transport Format
7 6 5 4 3 2 1 0
H'0 to H'3
dCSWSignature
H'4 to H'7
dCSWTag
H'8 to H'B
dCSWDataResidue
H'C bCSWStatus
•
dCSWSignature:
Signature that helps identify this data packet as a CSW. The signature field contains the value H'53425355 (little
endian).
•
dCSWTag:
A Command Block Tag. The function sets this field to the value received in the dCBWTag of the associated CBW.
•
dCSWDataResidue:
The function shall report in the dCSWDataResidue the difference between the amount of data expected as stated in
the dCBWDataTransferLength, and the actual amount of data processed by the function.
•
bCSWStatus:
bCSWStatus indicates the success or failure of the command. The function sets this byte to H'00 if the command
completed successfully. A non-zero value shall indicate a failure during command execution; H'01 indicates
"Command failed", and H'02 indicates "Phase error".