USB MSC Device won't stay ejected

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

USB MSC Device won't stay ejected

2,922件の閲覧回数
mukelarvin
Contributor IV

I am having trouble getting my device to eject when the user ejects the USB Mass Storage Device from a PC.

I am able to observe the kUSB_DeviceMscEventStopEjectMedia event but then my device just remounts again. Is there a step that I am missing? Do I need to disable the MSC device somehow?

0 件の賞賛
返信
8 返答(返信)

2,906件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi @mukelarvin ,

I tested RT1060_dev_msc_ramdisk. After eject, the device doesn't mount again. How did you test?

 

Regards,

Jing

0 件の賞賛
返信

2,903件の閲覧回数
mukelarvin
Contributor IV

I am using the IMXRT1050-EVKB with SDK v2.10.0 and example evkbimxrt1050_dev_msc_ramdisk_bm. I get the same result using our custom board design.

The device will mount but when I press eject the device immediately remounts. I see the same behaviour on both Windows and Mac.

I added a case to catch the eject event but the stack doesn't seem to do anything with it.

case kUSB_DeviceMscEventStopEjectMedia:
eject_handler(); // increment eject count
error = kStatus_USB_Success; // the calling function doesn't even look at this
break;
0 件の賞賛
返信

2,891件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi @mukelarvin ,

I tested on RT1050 EVKB and use SDK2.10.0 now on win10. But it is fine. It will not remount after eject.

Then I tested on Mac. It seems it has initialize problem. So, it can't eject. If click eject, the message will appear again.

 

Regards,

Jing

0 件の賞賛
返信

2,883件の閲覧回数
mukelarvin
Contributor IV

Hi @jingpan,

We noticed something unusual. I was right-clicking on the device in the File Explorer and selecting eject. Then my coworker tried using the eject dialog in the task bar and then it ejects cleanly.

How were you ejecting the device? I'm going to try both ways in debug and see how it behaves.

 

L.M.

0 件の賞賛
返信

2,859件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi,

Yes, same with you. So, it seems a host issue. When you eject msc disk in file explorer or in eject dialog, there is nothing happened in device USB stack. The device is still in connection status. So, I think this is only a host issue. Windows/Mac tell user it is save to remove disk. Windows will not access disk any more. That's it. In your case, you needn't worry about it.

 

Regards,

Jing

0 件の賞賛
返信

2,824件の閲覧回数
mukelarvin
Contributor IV

This is still an issue for us because we need to know when the user ejects the Mass Storage Device because we need to remount access to the file system from the MCU. We are caching data in RAM that needs to be saved to flash before we do a power cycle.

We have decided to fully remove USB Mass Storage and switch to serial data transfer over the CDC COM port.

So the specific issue is not resolved. We have just decided to use a different interface.

0 件の賞賛
返信

2,816件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi @mukelarvin ,

I found that if eject in file explore, there is really nothing different. But if eject by the little dialog, USB_DeviceEhciInterruptTokenDone() interrupt and USB_DeviceEhciInterruptSof() interrupt don't come any more.

 

Regards,

Jing

0 件の賞賛
返信

2,877件の閲覧回数
mukelarvin
Contributor IV

@jingpan It looks like the kUSB_DeviceMscEventStopEjectMedia event isn't called when I press eject from the Taskbar. I'm still trying to see what happens in that case.

0 件の賞賛
返信