Hi John,
Thanks for your reply.
I think I've figured the root cause of this issue.
If you want to eject the 'USB Disk', the host PC will send the STOP UNIT Command to USB device, however USB device can't response to this command, as there's no related command function in the USBD_MSC_INIT_PARAM_T struct which only includes the Read, Write, Verify, etc.
typedef struct USBD_MSC_INIT_PARAM
{
uint32_t mem_base;
uint32_t mem_size;
uint8_t* InquiryStr;
uint32_t BlockCount;
uint32_t BlockSize;
uint32_t MemorySize;
uint8_t* intf_desc;
void (*MSC_Write)( uint32_t offset, uint8_t** src, uint32_t length, uint32_t high_offset);
void (*MSC_Read)( uint32_t offset, uint8_t** dst, uint32_t length, uint32_t high_offset);
ErrorCode_t (*MSC_Verify)( uint32_t offset, uint8_t buf[], uint32_t length, uint32_t high_offset);
void (*MSC_GetWriteBuf)( uint32_t offset, uint8_t** buff_adr, uint32_t length, uint32_t high_offset);
ErrorCode_t (*MSC_Ep0_Hdlr) (USBD_HANDLE_T hUsb, void* data, uint32_t event);
uint64_t MemorySize64;
} USBD_MSC_INIT_PARAM_T;
Have a great day,
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------