controlling the multiplexer for KBA218460

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

cross mob
ScGr_289066
Level 5
Level 5
100 replies posted 50 replies posted 25 replies posted

Hi,

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

Thanks,

Scott

0 Likes
1 Solution
RajathB_01
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

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

View solution in original post

0 Likes
2 Replies
RajathB_01
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

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

0 Likes

Thanks Rajath, just what I was after.

Scott

0 Likes