Porting MSC to an RTOS

The RTOS layer must implement the API functions listed in Table - RTOS API Functions. You can start by referencing the RTOS port template located under:

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

Please refer to the MSC OS Functions Reference page for a full API description.

Table - RTOS API Functions
FunctionOperation
USBD_MSC_OS_InitInitializes MSC OS interface. This function will create both signals (semaphores) for communication and enumeration processes. Furthermore, this function will create the MSC task used for the MSC protocol. If µC/FS storage layer is used with removable media, the Refresh task will be created.
USBD_MSC_OS_CommSignalPostPosts a semaphore used for MSC communication.
USBD_MSC_OS_CommSignalPendWaits on a semaphore to become available for MSC communication.
USBD_MSC_OS_CommSignalDelDeletes a semaphore if no tasks are waiting for it for MSC communication.
USBD_MSC_OS_EnumSignalPostPosts a semaphore used for MSC enumeration process.
USBD_MSC_OS_EnumSignalPendWaits for a semaphore to become available for MSC enumeration process.
USBD_MSC_OS_TaskTask processing the MSC protocol. Refer to the Mass Storage Task Handler section for more details about this task.
USBD_MSC_OS_RefreshTaskTask responsible for removable media insertion/removal detection. This task is only present when µC/FS storage layer is used with removable media.