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.

USB re-enumeration after disconnect/re-connect

Hi,

I'm using the C5515 ezdsp and the CSL USB-DMA example. I've found that enumeration does not occur if I run the example without having USB0 connected in advance. I've found some piece of code in this forum to solve this problem. However, I still have the problem that re-enumeration does not happen if I disconnect the cable and then re-connect it. What do I have to add to the code (I guess in usb_isr function)?

Thank you very much for your answers.

Best regards,

Andreas

 

  • Hi Andreas,

    I just want to make sure that you are using the latest version of the Chip Support Library for the C5515 eZdsp.

    Are you using C55XCSL-LOWPOWER  v2.10.00.00?

    http://software-dl.ti.com/dsps/dsps_public_sw/dsps_swops_houston/C55X/CSL-c55x-lowpower-versions.htm

    Thanks,
    Mark

  • Hi Mark,

    I'm using the latests version (2.10). Did not solve the problem in the mean time.
    But what I've found is that if I unplug the cable, I have several interrupts, including disconnect interrupt. When I replug the cable I have no interrupt (in particular no connect interrupt).

    Andreas

     

  • Hi Andreas,

    The USB cable disconnect/reconnect function is not implemented in the USB example 1-3. It is in the USB example 4. You can add this function easily by replacing the attached file to the USB example 2.

    If you you look into the code, you should be able to see the main changes are:

    1. Add a global bool varible usbDevDisconnect

    2. Change the following code section in usb_isr

      /* Disconnect interrupt */
      if(pContext->dwIntSourceH & CSL_USB_GBL_INT_DEVDISCONN)
      {
       status = USB_disconnectDev(CSL_USB0);
       usbDevDisconnect = TRUE;
       if(status != CSL_SOK)
       {
        printf("USB Disconnect failed\n");
       }
      }

    3. change the following code section in CSL_usbIntcTest

     while(stopRunning != TRUE)
     {
      if ((usbDevDisconnect == TRUE) &&
         (CSL_FEXT(usbRegisters->DEVCTL, USB_DEVCTL_VBUS) !=
                  CSL_USB_DEVCTL_VBUS_ABOVEVBUSVALID))
      {
       printf("\nUSB Cable Disconnected!!\n");

       while(CSL_FEXT(usbRegisters->DEVCTL, USB_DEVCTL_VBUS) !=
                         CSL_USB_DEVCTL_VBUS_ABOVEVBUSVALID);

       printf("USB Cable Connection Detected!!\n");

       usbDevDisconnect = FALSE;
       USB_connectDev(CSL_USB0);

      }
     }

    Best regards,

     

    Ming

  • Hi Ming,

    Great thanks for this, it works perfectly here.

    Best regards,

    Christos

     

  • Hi Ming,

    Thank you so much for your help. This is great work!

    Best regards,

    Andreas