Porting MSC to a Storage Layer

The storage layer port must implement the API functions summarized in Table - Storage API Functions. You can start by referencing to the storage port template located under:

Micrium\Software\uC-USB-Device-V4\Class\MSC\Storage\Template

You can also refer to the RAMDisk storage and µC/FS storage located in Micrium\Software\uC-USB-Device-V4\Class\MSC\Storage\ for a more detailed example of storage layer implementation.

Please refer to the MSC Storage Layer Functions Reference for a full description of the storage layer API.

Table - Storage API Functions
Function NameOperation
USBD_StorageInit()Initializes internal tables used by the storage layer.
USBD_StorageAdd()Initializes storage medium.
USBD_StorageCapacityGet()Gets the storage medium’s capacity.
USBD_StorageRd()Reads data from the storage medium.
USBD_StorageWr()Writes data to the storage medium.
USBD_StorageStatusGet()Gets storage medium’s status. If the storage medium is a removable device such as an SD/MMC card, this function will return if the storage is inserted or removed.
USBD_StorageLock()Locks access to the storage medium.
USBD_StorageUnlock()Unlocks access to the storage medium.
USBD_StorageRefreshTaskHandler()Checks the removable media presence status, that is insertion/removal detection. Defined only for the µC/FS storage layer.