FX3 re-enumeration from altsetting

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 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. 

0 Likes
2 Replies
Anonymous
Not applicable

Hi,

   

>  there is timeout while responding to SET_CONFIGURATION request,

   

You probably missed to call CyU3PUsbAckSetup before USB disconnect.

   

Regards,

   

K

0 Likes
Anonymous
Not applicable
    Hi,   
   
        
   
    Sorry, I was so hurry with reply. Of course not calling CyU3PUsbAckSetup should not affect reenumeration because from host viewpoint the USB is reset anyway. But, you never know, maybe it's still good to call it and return CyTrue from Setup callback to keep device setup handler and host setup requests in sync. See my post http://www.cypress.com/?app=forum&id=167&rID=68852   
   
        
   
    Regards,   
   
    K   
0 Likes