Memory Cards Mass Storage Drivers
MC9S12UF32 Card Reader Reference Design User Manual, Rev. 0.1
32
Freescale Semiconductor
Figure 7-4. SCSI Command Write Packet
7.4.3 Host Receives Data from Card Reader.
The commands supported are:
•
Request Sense (card reader returns error code of the global variables gUSBMSSenseKey[card]
and gUSBMSAddSenseKey[card] to host)
•
Inquiry (card reader returns card information to host)
•
Mode Sense (card reader returns mode sense data)
•
Read Capacity (card reader returns total capacity to host)
•
Read Packet (card reader returns data to host by setting up the IQUEUE channels)
Figure 7-5
shows the flow of the SCSI command read packet. The data of the corresponding LBA will be
sent to host once the UF32 received the SCSI read command. The logical to physical block address
translation is needed for SM and MS only.
SCSI Command Write_10
Get LBA
Update LogToPhyTbl
if necessary
Decode LBA to PBA
Write data to PBA
from unused Block
Write all pages within
within a Block
Erase the orginal Block
Update LogToPhyTbl
Finish writing
all LBAs ?
NO
YES
RETURN