cancel
Showing results for 
Search instead for 
Did you mean: 

I can't temporarily remove USB MSC from a composite USB MSC+CDC device.

iharihar2
Associate
Posted on July 04, 2018 at 21:15

I have composite USB MSC+CDC device. I am trying to temporarily remove MSC from composite USB MSC+CDC device. MCU is STM32F429.

I used recommendation from here 

https://community.st.com/0D50X00009XkYbeSAF

but it was not successful.

Using CDC command I set the special bit caused negative result(-1) of function ' SCSI_TestUnitReady()'. After PC Host command 'SCSI Test Unit Ready' my USB device sent the response with flag 'SCSI Status: Command failed'. After that PC USB HOST released 'SCSI Request Sense Lun' and my device answered 'SCSI Request Sense Response LUN' where I could see flags 'Sense key = Not Ready' and 'Code_Qualifier = Medium not Present' have been sent to USB HOST side.

But USB MSC drive sign kept being visible in my Windows  PC Explorer. Meanwhile USB HOST continued sending new commands to my MSC device: successively 4 command sequences: ':SCSI Test Unit Ready' ,' SCSI Requst Sense Lun' then 2 times 'SCSI Read Capacity', then 'SCSI Read_10( LBA:0)' and last command ' TestUnit Ready' after 20-30 second of pause. After it USB device function of my board was stuck.

I have the same result on Windows 7 and Windows 10 as well.

I would be appreciate some advises for fixing my problem.

null
1 REPLY 1

The Read Capacity and Read_10 should just throw error, and push Medium Not Present to subsequent Sense Requests.

Try using a SCSI/SRB logger on Windows, and play games with your CD/DVD drive to better understand the requests and senses thrown, with and without media, and how it transitions with eject/load

Make sure your INQUIRY indicates media is removable.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..