2 Replies Latest reply on Oct 11, 2019 4:29 AM by ScGr_289066

    controlling the multiplexer for KBA218460

    ScGr_289066

      Hi,

       

      I'm after the technical details of how firmware controls the PI3USB302-A multiplexer SEL pin to implement your KBA218460 solution.

       

      Thanks,

      Scott

        • 1. Re: controlling the multiplexer for KBA218460
          RajathB_01

          Hello Scott,

           

           

          Following is the sequence that we are following in FX3 firmware for mux control.

           

           

          1)Disable the USB2 support.

          2)Try to establish USB3 connection using the first USB3 pair.

          3)check for CY_U3P_USB_EVENT_SS_COMP_ENTRY and CY_U3P_USB_EVENT_USB3_LNKFAIL.

          If any of the two event gets triggered, do the following:

          a)disable the USB PHY by using CyU3PConnectState(CyFalse, CyFalse);

          b)toggle the mux selection GPIO.

          c)enable the USB 2.0 support

          d)Call connectstate API to establish a USB 3.0 connection using the second pair.

           

           

          Following is an example code snippet. I hope it will be helpful.

           

           

          status = CyU3PUsbControlUsb2Support(CyFalse);

            if (status != CY_U3P_SUCCESS)

            {

              CyU3PDebugPrint(4,"\r\nDisabling USB2 failed. Stopping Execution");

              while(1);

            }

           

           

            CyU3PThreadSleep(20);

           

           

            status = CyU3PConnectState(CyTrue, CyTrue);

            CyU3PThreadSleep(50);

            for(int i =0 ; (i<100 && !U3_EVENT); i++ )

            CyU3PThreadSleep(5);

           

           

            if(!U3_TRUE)

            {

            CyU3PDebugPrint(5,"\r\nNot Super speed enumeration with MUX_SEL low. Flipping Mux to try again");

            CyU3PConnectState(CyFalse, CyFalse);

            CyU3PGpioSetValue(SS_MUX_SEL_GPIO22,CyTrue);

            CyU3PUsbControlUsb2Support(CyTrue);

            CyU3PThreadSleep(20);

            status = CyU3PConnectState(CyTrue, CyTrue);

            CyU3PThreadSleep(50);

            if (status != CY_U3P_SUCCESS)

            {

                  CyU3PDebugPrint (4, "\n\rAppInit:ConnectState Err = 0x%x", status);

                  CyCx3UvcAppErrorHandler(status);

            }

           

           

            }

            else

            {

            CyU3PDebugPrint(5,"\r\nSuper speed enumeration with MUX_SEL low");

            }

           

          Regards,

          Rajath

          • 2. Re: controlling the multiplexer for KBA218460
            ScGr_289066

            Thanks Rajath, just what I was after.

            Scott