USB Libraries Help > USB Host Libraries > USB MSD Host Client Driver Library > Library Interface > b) Data Types and Constants > USB_HOST_MSD_ERROR_CODE Enumeration
MPLAB Harmony USB Stack
USB_HOST_MSD_ERROR_CODE Enumeration

USB Host MSD Error Codes. 

This enumeration defines the codes that the MSD Client Driver returns for possible errors that lead to the device being placed in an error state. The MSD client driver will not operate on a device which is in an error state. The error are returned in the USB_HOST_MSD_ErrorCallback function.

C
typedef enum {
  USB_HOST_MSD_ERROR_CODE_INSUFFICIENT_INSTANCES = 1,
  USB_HOST_MSD_ERROR_CODE_NOT_FOUND_BULK_IN_ENDPOINT,
  USB_HOST_MSD_ERROR_CODE_NOT_FOUND_BULK_OUT_ENDPOINT,
  USB_HOST_MSD_ERROR_CODE_FAILED_PIPE_OPEN,
  USB_HOST_MSD_ERROR_CODE_FAILED_GET_MAX_LUN,
  USB_HOST_MSD_ERROR_CODE_FAILED_BOT_TRANSFER,
  USB_HOST_MSD_ERROR_CODE_FAILED_RESET_RECOVERY,
  USB_HOST_MSD_ERROR_CODE_CBW_STALL_RESET_RECOVERY,
  USB_HOST_MSD_ERROR_CODE_TRANSFER_BUSY,
  USB_HOST_MSD_ERROR_CODE_CSW_PHASE_ERROR,
  USB_HOST_MSD_ERROR_CODE_CSW_UNKNOWN_ERROR
} USB_HOST_MSD_ERROR_CODE;
Members
Members 
Description 
USB_HOST_MSD_ERROR_CODE_INSUFFICIENT_INSTANCES = 1 
This error occurs when the number of MSD instances defined via

 

USB_HOST_MSD_ERROR_CODE_NOT_FOUND_BULK_IN_ENDPOINT 
This error occurs when the driver descriptor parser could not find a Bulk

 

USB_HOST_MSD_ERROR_CODE_NOT_FOUND_BULK_OUT_ENDPOINT 
This error occurs when the driver descriptor parser could not find a Bulk

 

USB_HOST_MSD_ERROR_CODE_FAILED_PIPE_OPEN 
This error occurs when the driver could not open a Bulk pipe. This

 

USB_HOST_MSD_ERROR_CODE_FAILED_GET_MAX_LUN 
This error occurs when the Get Max LUN request issued by the driver fails

  • for any reason. The object identifier in this case will be the MSC device
  • instance index.

 

USB_HOST_MSD_ERROR_CODE_FAILED_BOT_TRANSFER 
This error occurs when any stage of the BOT has failed due to bus error

  • or an unknown failure. The object identifier in this case will be the MSC
  • device instance index.

 

USB_HOST_MSD_ERROR_CODE_FAILED_RESET_RECOVERY 
This error occurs when the MSD Reset Recovery procedure has failed. A MSC

  • device should not fail a MSD Reset Recovery procedure. The object
  • identifier in this case will be the device instance index.

 

USB_HOST_MSD_ERROR_CODE_CBW_STALL_RESET_RECOVERY 
This error code indicates a condtion where the CBW stage of the BOT was

  • stalled and the driver is about to launch MSD reset recovery. The
  • identifier in this case if the MSC Device instance index. This code is
  • generated from an interrupt context. The driver may continue to function
  • normally post this condition.

 

USB_HOST_MSD_ERROR_CODE_TRANSFER_BUSY 
This error code indicates a condition where the BOT transfer could not be

  • initiated because a transfer is already in progress. The identifier in
  • this case is the MSC Device Instance Index. The driver may continue to
  • function normall post this condition. This condition may occur several
  • times.

 

USB_HOST_MSD_ERROR_CODE_CSW_PHASE_ERROR 
This error code indicates a condition where the BOT transfer failed due a

  • phase error in the CSW stage of the BOT. The identifier in this case if
  • the MSC Device instance index. This code is generated from an interrupt
  • context. The driver may continue to function normally post this
  • condition.

 

USB_HOST_MSD_ERROR_CODE_CSW_UNKNOWN_ERROR 
This error code indicates that a condition where an unknown error has

  • occured during the CSW stage of the BOT. The identifier in this case if
  • the MSC Device instance index. This code is generated from an interrupt
  • context. The driver may continue to function normally post this
  • condition.

 

Remarks

None.