8 Replies Latest reply on Mar 21, 2013 3:29 AM by han.xshan

    FX3 re-enumeration for exchanging high speed & super speed

    han.xshan

      Hello.

         

      I want to exchange FX3 super speed to high speed at run time. but it fail. my code as below:

         

      it is soming wrong or need do more? please help.

         

                      apiRetStatus = CyU3PConnectState(CyFalse, CyFalse); //disconnect
                      if (apiRetStatus != CY_U3P_SUCCESS) {
                          CyU3PDebugPrint (4, "USB disconnect failed, Error code = %d\r\n", apiRetStatus);
                      }

                      CyU3PThreadSleep (10);

                      apiRetStatus = CyU3PConnectState(CyTrue, CyFalse); //connect with High speed
                      if (apiRetStatus != CY_U3P_SUCCESS) {
                          CyU3PDebugPrint (4, "USB Connect failed, Error code = %d\r\n", apiRetStatus);
                      }

        • 1. Re: FX3 re-enumeration for exchanging high speed & super speed
          gayathri.vasudevan

           Hi,

             

           

             

          When it fails what is the error code returned? I believe it is the secodn call that is failing. Confirm the same.

             

           

             

          Regards,

             

          Gayathri

          • 2. Re: FX3 re-enumeration for exchanging high speed & super speed
            shashank.rebbapragada

             Hi,

               

             

               

            Try to increase the value passed in the ThreadSleep() API. Try CyU3PThreadSleep(100) and see if it helps.

               

             

               

            Regards

               

            Shashank

            • 3. Re: FX3 re-enumeration for exchanging high speed & super speed
              han.xshan

              Hi,Gayathri & Shashank:

                 

              NO errocode be return, and I update sleeptime to 100, it is not work!

                 

              I set to HIGH speed after firmware boot, and use vendor command to change it to SUPER speed, it's OK.

                 

              but  set to SUPER speed after firmware boot, and change it to HIGH speed, it's FAIL, no usbdevice be in windows device manager..

                 

              next is my part code:

                 

              --------------------------------------------------------------------------------------------------------------

                 

                      case VR_FW_SET_USBSPEED:  //switch usb speed
                          //Request with OUT data phase. Just get the data and ignore it for now. */
                          CyU3PUsbGetEP0Data (sizeof (glEp0Buffer), (uint8_t *)glEp0Buffer, &wLength);
                          // Complete the control request.
                          CyU3PUsbAckSetup ();
                          CyU3PThreadSleep (10);

                          if (glIsApplnActive) {
                              ApplnStop (); // Stop the application before re-starting.
                              CyU3PThreadSleep (100);
                          }

                          if (wValue) { //!!!  OK from highspeed to super speed
                              apiRetStatus = INA209_set_swp(FLAG_SUPERSPEED);
                              if (apiRetStatus != CY_U3P_SUCCESS) {
                                  CyU3PDebugPrint (4, "Set SUPERSPEED flag failed, Error code = %d\r\n", apiRetStatus);
                              }

                              apiRetStatus = CyU3PConnectState(CyFalse, CyFalse); //disconnect
                              if (apiRetStatus != CY_U3P_SUCCESS) {
                                  CyU3PDebugPrint (4, "USB disconnect failed, Error code = %d\r\n", apiRetStatus);
                              }

                              CyU3PThreadSleep (100);

                              apiRetStatus = CyU3PConnectState(CyTrue, CyTrue); //connect with Super speed
                              if (apiRetStatus != CY_U3P_SUCCESS) {
                                  CyU3PDebugPrint (4, "USB Connect failed, Error code = %d\r\n", apiRetStatus);
                              }
                          } else {  //!!! FAIL from highspeed to super speed
                              apiRetStatus = CyU3PConnectState(CyFalse, CyFalse); //disconnect
                              if (apiRetStatus != CY_U3P_SUCCESS) {
                                  CyU3PDebugPrint (4, "USB disconnect failed, Error code = %d\r\n", apiRetStatus);
                              }

                              CyU3PThreadSleep (100);

                              apiRetStatus = CyU3PConnectState(CyTrue, CyFalse); //connect with High speed
                              if (apiRetStatus != CY_U3P_SUCCESS) {
                                  CyU3PDebugPrint (4, "USB Connect failed, Error code = %d\r\n", apiRetStatus);
                              }
                          }
                          isHandled = CyTrue;
                          break;

              • 4. Re: FX3 re-enumeration for exchanging high speed & super speed
                han.xshan

                sorry for some wrong message at last reply.

                   

                after changing SS to HS fail!, widows show a UNKNOWN DEVICE!

                • 5. Re: FX3 re-enumeration for exchanging high speed & super speed
                  rama.sai.krishna.vakkantula

                  Hi,

                     

                  You might be using SDK 1.2.1, if I am not wrong.

                     

                  Actually this bug was there in the SDK1.2.1 and it has been fixed in the later releases.

                     

                  Could you please test with the latest SDK (1.2.3 or 1.2.2 if you have).

                     

                  You can download the latest SDK from the following webpage:

                     

                  http://www.cypress.com/?rID=57990

                     

                   

                     

                   

                     

                  Thanks,

                     

                  Sai Krishna.

                  • 6. Re: FX3 re-enumeration for exchanging high speed & super speed
                    han.xshan

                    yes, I use 1.2.1.

                       

                    I will try 1.2.3. thanks

                    • 7. Re: FX3 re-enumeration for exchanging high speed & super speed
                      han.xshan

                      1.2.3 is OK for my firmware.

                         

                      thanks for all.