On my Atmel SAM4E-EK I have a USB composite device setup (MSC + CDC over USB), hooked up to a Windows 7 PC. Sometimes I want to disable the MSC and let the CDC class be, is this at all possible given the USB 2.0 specification?

I imagine a solution to my problem would be to discard all the MSC USB packets in conjunction with a forced enumeration (by the host but issued from the device).

This situation is similiar to this question as I have a FATFS filesystem on the SD card which gets exposed to the PC over USB MSC and I want to have some kind of mutex over the filesystem so that it does not get corrupted from simultaneous accesses.


You could pretend that you have a removable disk, and that the user ejected it.

Alternatively, remove all MSC descriptors, and force re-enumeration (disconnect the D+ pullup resistor to simulate unplugging the entire USB device).

| improve this answer | |
  • \$\begingroup\$ I tried this approach and it kind of works. The problem is that I want the CDC part of my USB connection intact. \$\endgroup\$ – Entalpi Jun 28 '17 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.