Porting MSC to an RTOS

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

Function

Operation

USBD_MSC_OS_Init

Initializes 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_CommSignalPost

Posts a semaphore used for MSC communication.

USBD_MSC_OS_CommSignalPend

Waits on a semaphore to become available for MSC communication.

USBD_MSC_OS_CommSignalDel

Deletes a semaphore if no tasks are waiting for it for MSC communication.

USBD_MSC_OS_EnumSignalPost

Posts a semaphore used for MSC enumeration process.

USBD_MSC_OS_EnumSignalPend

Waits for a semaphore to become available for MSC enumeration process.

USBD_MSC_OS_Task

Task processing the MSC protocol. Refer to the Mass Storage Task Handler section for more details about this task.

USBD_MSC_OS_RefreshTask

Task responsible for removable media insertion/removal detection. This task is only present when µC/FS storage layer is used with removable media.