USB Mass Storage driver layers:
1. Starting from the simplest "Physical Layer", we will first introduce the structure of MSC (Mass Storage Class) device and usb host:
Storage media is the NAND flash chip in our example.
The control chip in the example is a collection of microcontroller with embedded USB device controller and media controller.
The usb msc (Mass Storage Class) device can be divided into the following categories in the application field:
A commonly used USB flash drive, as in the preceding example, belongs to flash drive, that is, the physical data storage media uses flash memory. For example, the NAND flash chip in this example corresponds, media controller, the Controller of NAND Flash, reads and writes data from the NAND flash chip.
The firmware or hardware (hardware) in the usb msc device must implement the following features:
- Detects and responds to general USB requests and events on the USB bus.
- Detects and responds to the USB Mass Storage request for information or actions from the USB device.
- Detects and responds to SCSI commands obtained from USB transfer. These industry-standard commands are used to obtain status information, control device operations, and read (read block) and write (write block) data from the storage media block.
In addition, if a device wants to create/read/write files/folders to the storage medium, it involvesFile SystemTo implement the corresponding file system.
2. The mass storage framework is as follows:
The previous article introduced the registration of SCSI and the USB Mass Storage protocal.
In addition to its own USB protocol, mass storage is one of the USB protocols, and USB mass storage has its own related protocols:
- Mass Storage Class Specification overview 1.4
- Mass Storage bulk only 1.0
- Mass Storage control/bulk/interrupt (CBI) specification 1.1
- Mass Storage UFI command Specification 1.0
- Mass Storage bootability Specification 1.0
- Lockable mass storage Specification 1.0 and adopters agreement-lockable mass storage IP Disclosure
- USB Attached SCSI protocol (uasp) V1.0 and adopters agreement