cancel
Showing results for 
Search instead for 
Did you mean: 

Disable a device MSC in USB Composite CDC + MSC

40802528
Associate II
Posted on May 26, 2014 at 18:52

Hi everyone!

I developed the USB Composite CDC+MSC. It worked right. Now, I want to disable a MSC and use CDC only. Do we have any way to do that (without re-connect the USB)? I tried to ignore the MSC packets IN/OUT by return the NAK signal. However, the CDC can transfer several strings then stop.

void EP2_OUT_Callback(void)
{
if (MSC_Enable)
{
Mass_Storage_Out();
}
else
{
SetEPTxStatus(ENDP2, EP_RX_NAK);
}
}

Thank you so much. #stm #usb-composite
5 REPLIES 5
chen
Associate II
Posted on May 28, 2014 at 13:03

Hi

I have not tried USB MSC device, so I do not know much about it.

A quick scan through the USB OTG device library user manual, in the section for USB device MSC - it shows

SCSI_StartStopUnit

command. I think you need to send this command and say the 'unit' has stopped.

40802528
Associate II
Posted on May 29, 2014 at 12:23

Hi,

Thank for your reply.

I am using STM32F103 USB-FS-Lib, It does not support this function. However, I tried to understand the host's behavior when I did not reply its packet (MSC). The USB protocol shows that the host will send a reset command to the device in this case.

So that this reset command may be the reason why the CDC is halted also.

Finally, I switched the (CDC+MSC) to CDC only (using the button) by generate the reset signal and the device will be re-enumerated with new description. This is a simple trick to deal with this situation.

calvinday
Associate
Posted on October 30, 2014 at 20:02

Can you post the project? I am trying to implement a composite device CDC and MSC on the STM3220G-EVAL board. There are not many examples.

Hau Lam
Associate II
Posted on April 18, 2018 at 06:13

@dangthanhtung : Can i know how do you composite USB MSC + CDC ?

bronek
Associate II

I'm interested in composite usb cdc+msc. Few years ago I modified usb+msc on avr32. Now I need change platform to stm32. Can you post your project or usb configuration?