USB Composite CDC & MSC problem

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi guys,
I'm working on a UC3C micro to create a USB Composite (Device) CDC & MSC. I'm having an issue with the CDC interface. When the board is first plugged in, the CDC interface works great (for a few seconds). However, once the MSC interface finishes initializing, the device-to-host part of the CDC interface stops working.
I have proven that data gets from the host to the device, but not from the device to the host. I have proven this by single stepping and watching traffic using the USBlyzer tool. I see characters moving from the host to the device, but none get returned.

My assumption is that the MSC interface is reassigning some USB buffer/mailbox/endpoint-pipe away from the CDC so the buffer is never again marked used. Unfortunately I have not been able to find a good reference on this part of the USB framework.

Is there an app-notes which describe the USB buffer management? (More then is mentioned in AVR4900)
Have you seen this before?
Have any ideas that might help?

---------------
Here's more info on what I've done and how I got here:
I started with this project:
ASF USB Device MSC (UC3-EK Eval)
This project makes the onboard Flash and the SD/MMC card appear as a mass-storage (MSC) device on the host. I stripped out the on-board Flash from the project so only the SD shows up. Then removed the Single-USB device descriptors and merged in the Composite descriptor from:

ASF USB Composite Device Example CDC and MSC (EVK1101)
This project implements the CDC but only exposes the on-board Flash memory as MSC.

There appear to be two USB frameworks, an "B" and "C" which I assume is for the two different processors. The EVK1101 is a UC3B, and the UC3-EK is a UC3C. Going from the B to C USB framework may be my issue, but I have not been able to track this down either. They seem to support the same conf_usb.h file from what I can tell, but maybe I am missing something.

My final project uses the UC3C processor, and requires the MSC to be an SD card. I have all of this working, except for the odd disappearing CDC traffic from the device to host once the MSC is running.

Thanks in advance!
Voytek

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry for bringing up this old post, but I have exactly the same problem. (But using SAM4S.)

Sometimes it works directly, both CDC and MSC. Sometimes the CDC port works and it takes a long time for the mass storage interface to "pop-up", but once it does the device to host CDC communication stops working.

Did you find a solution, or do anybody have any idea on what to do?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Same here too. Though using LUFA ported to STMF103 (I know, this is AVR forum, but this issue seems to be general) I'm experiencing something similar. 

Using composite device (IAD) with CDC+AS(MIDI)+MSC. MSC is not enumerated properly most of the times, but then CDC and MIDI works.

When MSC enumerates, MIDI stops working (no more IN tokens seen to MIDI EP), CDC disconnects. Though CDC could be brought back after closing and reopening terminal app (putty). CDC Line States changes during MSC transfers or enumeration.

 

Already tried to renumber endpoints and interfaces (not forgetting uninstalling device and rescan) but I can't manage it to work so far. 

 

And one more observation, if device enumerates to state that MSC is not working, it takes 15 USB resets. When it enumerate (MSC), it takes much more USB bus resets (35).

 

If we are seeing similar behavior on different MCUs and different USB stacks, it could be more general system issue.

 

T.

Last Edited: Sat. Mar 4, 2017 - 01:59 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, as usually after weeks of struggling posting on forum here made me solve this hours after.

What was the essential is that standard requests for clear/set feature for MSC endpoints was not working corectly (LUFA uses just EP numbers without direction bit so I had to change implementation). [ MSC tried to stall/clear wrong endpoint part which causes spurious resets on bus from host to fix this state ].

And final nail seems to be that I had to renumber endpoints on MIDI interface.

Now it seems to be working correctly, MIDI works together with CDC and MSC. Reset count also dropped to 2, which seems to be alright.

Last Edited: Sun. Mar 5, 2017 - 08:59 AM