7 Replies Latest reply on Sep 10, 2018 2:20 AM by srnt

    PHY_ERROR_DECODE

    user_193279881

      Hello,

      I'm programming FX3 on a board developed by my colleague.

       

      We are printing on console (by means UART and CyU3PDebugPrint)

      PHY error counter and LNK error counter obtained by CyU3PUsbGetErrorCounts API.

       

      We observe that PHY counter reaches 6 if we have USB3.0 connected to PC when software not communicate.

      When software transfers some data counter increases, it reaches 5000 if we Xfer 1Kbyte of Data continuously.

       

      We read at page 495 of EZ-USB FX3 TRM, Spec No. 001-76074 Rev. *E register LNK_PHY_ERROR_CONF:

      this register can configure the types of PHY errors that the counter counts enabling/disabling the type of errors.

       

      By means of LNK_PHY_ERROR_CONF we understand that there are just "8b/10b Decode Errors" (see page 8b/10b encoding - Wikipedia).

       

      Our question is: what are this errors ?

       

      Our software communicate correctly (so at APPLICATION level there is not problem) but why there are this 8b/10b errors ?

       

      We change USB3 cable, demo board instead of our board, Host port, PC .... but systematically this error appears in the same way.

       

      Can anyone explain me this error ?

       

      Thank you in advice..

        • 1. Re: PHY_ERROR_DECODE
          srnt

          Hello,

           

          - 8b/10b decode errors indicate that the 10 bit symbols received do not match with any valid 8 bit data and this error is reported by the PHY and notified to the link layer as well. These errors could possibly be because of longer cable lengths, noise interference, etc. Kindly, ensure that you have followed the design guidelines mentioned in the AN70707.

          - Please let know if you have tried using the Cypress FX3 SuperSpeed Explorer Kit (CYUSB3KIT-003).

          - Also, does the device get disconnected upon encountering large number of PHY errors?

           

          Best regards,

          Srinath S

          • 2. Re: PHY_ERROR_DECODE
            user_193279881

            We observe this behavior on CYUSB3KIT-003 and our board

            We not observe disconnect with large numbers of PHY errors ...

             

            Now we are buying short USB3.0 and long USB3.0 cable to do some tests

            • 3. Re: PHY_ERROR_DECODE
              srnt

              Hello,

               

              When the device enters/exits low power modes, PHY errors can occur. Kindly, try using CyU3PLpmDisable() API to prevent the device entering into low power modes after the application is started.

               

              Best regards,

              Srinath S

              • 4. Re: PHY_ERROR_DECODE
                user_193279881

                Sorry but I don't find

                 

                CyU3PLpmDisable()

                 

                in

                 

                 

                EZ-USB® FX3 SDK

                 

                Firmware API Guide

                 

                 

                Version 1.3.3

                 

                • 5. Re: PHY_ERROR_DECODE
                  srnt

                  Hello,

                   

                  Apologies. Please look for CyU3PUsbLPMDisable() API.

                   

                  Best regards,

                  Srinath S

                  1 of 1 people found this helpful
                  • 6. Re: PHY_ERROR_DECODE
                    user_193279881

                    OK ... perfect !

                     

                    My code is developed from the existing cyfxgpiftousb.

                     

                     

                    After this answer I modify it in this way :

                     

                    • in "CyFxAppThread_Entry" there is a infinite loop for(;;) where I remove this code ...

                     

                     

                    /* Try to get the USB 3.0 link back to U0. */


                    if (glForceLinkU2)

                     

                     

                    {

                         stat = CyU3PUsbGetLinkPowerState (&curState);

                     

                         while ((glForceLinkU2) && (stat == CY_U3P_SUCCESS) && (curState == CyU3PUsbLPM_U0))

                     

                         {

                              /* Repeatedly try to go into U2 state.*/

                              CyU3PUsbSetLinkPowerState (CyU3PUsbLPM_U2);

                     

                     

                              CyU3PThreadSleep (5);

                              CyU3PUsbGetLinkPowerState (&curState);

                         }

                    }       

                     

                    else

                    {

                         /* Once data transfer has started, we keep trying to get the USB link to stay in U0. If this is done

                     

                         if (CyU3PUsbGetSpeed () == CY_U3P_SUPER_SPEED)

                     

                         {

                              /* If the link is in U1/U2 states, try to get back to U0. */

                     

                              stat = CyU3PUsbGetLinkPowerState (&curState);

                     

                              while ((stat == CY_U3P_SUCCESS) && (curState >= CyU3PUsbLPM_U1) && (curState <= CyU3PUsbLPM_U3))

                     

                              {

                                    CyU3PUsbSetLinkPowerState (CyU3PUsbLPM_U0);

                     

                     

                                   CyU3PThreadSleep (1);            

                     

                                   stat = CyU3PUsbGetLinkPowerState (&curState);

                     

                     

                              }

                         }

                    }

                     

                    • in "CyFxApplnUSBEventCB" there is a "switch(evtype)" where in the case "CY_U3P_USB_EVENT_CONNECT" I add this code

                     

                     

                    CyU3PReturnStatus_t status = CyU3PUsbLPMDisable();

                     

                    if(status!=CY_U3P_SUCCESS)

                     

                    CyU3PDebugPrint (8, "LPMDisable return Error %d\r\n",status);

                     

                     

                    With this solution my PHY counter is always 0 (except for an instance after CY_U3P_USB_EVENT_CONNECT where I read about 400 errors).

                     

                    Is this solution correct ? In particular I not understand the code involved in "ForceLinkU2" ...

                     

                     

                     

                     

                    • 7. Re: PHY_ERROR_DECODE
                      srnt

                      Hello,

                       

                      - glForceLinkU2 parameter is monitored to decide whether to enter low power mode or not. Whenever the interface is suspended by the host, the link is pushed into the U2 state thereby saving power.

                      - The mentioned approach is fine but another option would be to disable the low power entry in the CyFxApplnStart() function and re-enable it in the CyFxApplnStop() function.

                       

                      Best regards,

                      Srinath S

                      1 of 1 people found this helpful