Nosumor

* Implemented USB Mass Storage Class (MSC) for Micro SD card reader

Bulk-only transport was used for USB MSC. The protocol consists of 3 stages: Command Block Wrapper (CBW) OUT, Data Transport OUT/IN, Command Status Wrapper (CSW) IN. Multiple LUNs can be used for different disks: 47677f5 Bootloader USB interfaces Mass Storage Bulk Only 1.0 723a87a8ea8f63b83a0cf610811ad4661ba7b3a5

The USB MSC is basically an encapsulation layer of other storage protocols, such as the wildly used Small Computer System Interface (SCSI). The SCSI documentations are only available to t10 members or through purchasing. Fortunately, Seagate has a documentation with all necessary SCSI commands for a removable storage device. Together with SCSI codes on t10.org, I am able to implement a working layer of SCSI for the Micro SD card slot as a card reader. afa9107afffeaa8fed1b1146fca1f6f4fb789a7a

The essential SCSI commands are: TEST UNIT READY, INQUIRY, REQUEST SENSE, READ CAPACITY (10), READ (10) and WRITE (10)

To support removable devices, the operating system will continuously pull its status through the TEST UNIT READY command: 131ff4d Hot plug during write 30ecaf8ece2857c9469894619d860baed19539f0

For some unknown reason, Microsoft Windows (10) seems only supports small disks (less than 1MiB capacity) only if it is marked as removable. Linux has better support for these disks.