2 Replies Latest reply on Sep 18, 2012 1:02 PM by user_57556229

    FX3 re-enumeration from altsetting

    roman.necel

       Hello

         

      I'm trying to simulate two devices in one firmware application but I've a problem with reenumerating device. I have separate descriptors for each device and I want to switch between them using set_interface and altsetting (and flag glIsHid).

         

      According to USB analyzer after reenabling CyU3PConnectState there is timeout while responding to SET_CONFIGURATION request, unfortunately the situation is the same if I'm not switching the flag and  just trying to reenumerate device without changing descriptors. As a base I'm using BulkLoopAutoEnum. Code:

         

       

         

       case CY_U3P_USB_SC_SET_INTERFACE:

         

              {  glUsbInterface = wValue;

         

      if(wValue == HID_SWITCH_INTERFACE)

         

      {

         

      CyU3PReturnStatus_t apiRetStatus = CY_U3P_SUCCESS;

         

      glIsHid = CyTrue;

         

      apiRetStatus = CyU3PConnectState(CyFalse, CyTrue);

         

          if(apiRetStatus == CY_U3P_SUCCESS)

         

          CyU3PConnectState(CyTrue, CyTrue);

         

      }

         

              }

         

      With separate img each simulated device enumerates properly.

         

      Regards R.