This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USB double trouble

Hello,

I have a LPC2478 than I can address via 2 data sources: A CDC device and a USB to RS-485 converter. I see something very strange: If I try to use them in parallel, the USB CDC transfers are starting to logged by my sniffer as "canceled" - it is then required to unplug and re-plug the USB cable (of the CDC device). What is happening here?

Thanks in advance!

Parents Reply Children
  • I'm playing all the right notes - but not necessarily in the right order

    you have no idea ;-)

  • > I see that when I try to resend something to the device, a setup stage is triggered. Why is that?

    Sound like the CDC device driver try to reset the device USB engine, by sending bus reset.
    After bus reset, re-enumeration occurs. Even if the endpoint is stalled, it is released on the enumeration.

    As it doesn't recover your problem, it means that your firmware doesn't implement USB_Configure_Event() properly. USB_Configure_Event() is called when Set_Configuation request comes on enumeration.
    In this subroutine, your firmware should initialize the variables and flags which relate to USB communication.

    For example, suppose that you have a buffer to receive large data from an OUT endpoint.
    The buffer pointer is initialized to point to the top buffer in USB_Configure_Event().
    Also, your firmware have any status flags related to communication, the flags are also initialized.

    [code]
    usbuser.c

    #if USB_CONFIGURE_EVENT
    void USB_Configure_Event (void) {

    if (USB_Configuration) { /* Check if USB is configured */
    [b] /* add your code here */[/b] }
    } #endif
    [/code]

    Above suggestion is told just for recovery.
    The original source of the trouble is still under question.

    > but money still talks :-)

    Call for demonstration of the analyzers to the representatives :-)

    Tsuneo

  • Tsuneo,

    Thanks for your reply. I have found the cause: the UART interrupt changing a global variable caused the CDC device to fail to reply sometimes ! Thanks a lot for your advise!