This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Multiple CDC Interfaces Conflict

Other Parts Discussed in Thread: MSP430F6659

Hi,

I'm working on a project which I need to communicate four CDC Virtual Ports (USB) between a MSP430f6659 and the PC. It works fine when I start they separately. Connecting more than one, the communication becomes unstable and often looses data and I need to reconnect the MSP and PC USB.

All the boards have exactly the same code, the only difference is the PID value.
I already tried reducing max power to 150mA. I verify often in the device manager the connection and it's fine, only when I start to send data to the PC that it starts to fail.

I'm using all the functions included in the Developer's Package, also the code is taken from an example. It works fine individually. I use the sendDataWaitTilDone(...) function to send data to PC and receivefromBuffer(...) to receive in EP0.

Maybe you know something I'm not considering with multiple serial CDC.

Thanks,

  • Hi Daniel,

    First, I need to point out that you won't be able to reach four virtual COM ports in composite -- only three.  Each CDC interface uses up two IN endpoints (besides EP0 for control); and the MSP430 USB module has seven non-EP0 IN endpoints available.  Three CDC interfaces will fit -- but four would require eight IN endpoints, and we don't have that available. 

    If you needed four distinct pipes, and if the bandwidth on each was <64KB/sec, you might consider four HID interfaces in composite.  HID only using 1 IN and 1 OUT endpoint, so you can have up to seven of these. 

    I'm guessing you didn't use the Descriptor Tool to generate your descriptors -- it would've stopped you from trying to create four virtual COM ports.  We strongly recommend using the Descriptor Tool to create your USB interfaces -- it will catch numerous problems before they even start. 

    Are you saying it fails with only 2-3 CDC interfaces?  Have you tried the composite examples in the directory \MSP430_USB_API\examples\Composite_multipleInterfaces -- for example, CC1_term2term, which does a loopback between two CDC interfaces? 

    Keith

  • Hi Keith,

    Thank you so much for your answer! I used descriptor tool to generate my descriptor files, also the base code is just the same as the examples in the CDC_Examples from developer's package. Actually, I generated 4 different descriptors files for each board, not adding 4 interfaces in the same descriptor tool project. I don't know if this might be an issue. I used the same setup, changing only the PID and the Device Release Number for the four boards.

    Today, testing with the Device Manager open, I see that when the boards try to send something to the PC, the device manager refreshes, like if some connection was suddenly restarted. I'm considering the problem might be with the descriptors files, but don't know where to look for the problem yet.

  • OK, it's good you're using the Desc Tool. 

    It's still very unclear to me what your software looks like.  You say you're using an example as-is, but you also generated your own descriptors, which (for example) could potentially not match the example.  I would suggest you either give a very clear, reproducible description of your software (for example, "took TI's example ??, modified it in such and such exact way, and then used the Desc Tool to generate descriptors according to the attached *.dat file") -- or attach your project. 

  • I took TI's CDC_Example from Developer's Package and used all the code structure, I only changed the code within the case: "ST_ENUM_ACTIVE", where the program goes when USB is successfully connected. After that I generated my own descriptor files (descriptors.c, descriptors.h, UsbIsr.c and the MSP430.inf) and made a rebuild. The layout of the project is as it follows:

    There are four boards. They should work as individual Virtual Coms, testing a device and sending information to the host (PC). The PC gets the incoming data from the four boards at different COMS and process them.

    I'm getting a problem when connecting all the boards at the same time and running the Software at the PC to get the data, I don't know if this is really what's happening, but it seems they start loosing connection when the process begins.

  • OK, I think I understand your setup better. 

    • Four individual boards
    • each with a single CDC interface
    • each with its own VID/PID pair (same VID, different PID). 
    • Each seems to work (meaning, bidirectional communication; using a terminal app on the PC?) when it's the only board attached. 
    • But when all four boards are tried simultaneously, it fails. 
    • Failure seems to involve some kind of instability.
    • The instability is something like "when the boards try to send something to the PC, the device manager refreshes, like if some connection was suddenly restarted"

    You say you started from "CDC_Example", but there are seven single-interface CDC examples in the USB Dev Package, none by that name.  (Six of them, if you're using USB Dev Package v3.x -- which version are you using?).  Please indicate the exact example you started from, which should include a designator like "C1", "C2", etc.  We can only help you if we have exact information about your setup. 

    Or, are you even using an example from the USB Dev Package, or some other software? 

    With four different VID/PID pairs, and four different INF files generated by the Tool, Windows should've led you to associate each board with a unique INF file. 

    Have you tried only two boards at once, to see if that fails?  Generally speaking, I haven't heard of anything like this. 

    You said something about "receiving in EP0" -- I hope not.  EP0 is the control endpoint. 

    Regards,
    Keith

  • Keith,

    Thank you so much for your attention !


    It seems we found the problem, it was the baud rate. As we decreased it to 2400 (before 115200) all the ports are working fine now. I'll try to work deeper into this so I can find what was really causing the crashes, but for now all the four boards are working.

    Regards,

    Daniel

**Attention** This is a public forum