8 Replies Latest reply on Mar 3, 2019 7:25 PM by falu_294486

    CYPD4236 PR_SWAP fail

    MaLi_3529141

      Hi there,

       

      I just used CYPD4236 for Dock example code , call the API to do PR_SWAP:

      pd_prot_send_ctrl_msg(0,SOP,CTRL_MSG_PR_SWAP);

       

      However, UFP immediately issues Soft_Reset and aborts the action of PR_SWAP.

      (Please refer to the attachment for CC Log.)

       

      1. Why is soft_reset happening?

      2. How to complete PR_SWAP?

       

      thanks

       

       

        • 1. Re: CYPD4236 PR_SWAP fail
          ShifangZ_26

          Hi ,

           

          1. The best way to initial PR_SWAP without interrupt PD stack machine is:

           

          dpm_pd_command (US_TYPEC_PORT_IDX, DPM_CMD_SEND_PR_SWAP, NULL, NULL);

           

          You can add callback function for this to make sure PR_SWAP is completed. For example, dpm_pd_command (US_TYPEC_PORT_IDX, DPM_CMD_SEND_PR_SWAP, NULL, us_pr_swap_cb) in CCG4 dock example code.

           

          2. As per the CC log:

          First, CCG4 initial PR_SWAP here (Refer #1 on above picture), CCG4 is UFP and SINK Role.

          After DFP was "ACCEPT" PR_SWAP, CCG4 response with GOODCRC and then initial Soft_Reset(Refer #2 on above picture). As per PD3.0 SPEC, you can got below information:

          The strange is the DFP is again to "ACCEPT" (Refer #3 on above picture) after Soft_Reset. And then advertise SOURCE_CAP. The right process shall be: PS_RDY from OLD SOURCE (set it power to vsafe0V) and then PS_RDY from OLD SINK mode.

          The root cause is: DFP is not follow SPEC after Soft_reset message occurred.

           

          Best Regards,

          Lisa

          • 2. Re: CYPD4236 PR_SWAP fail
            falu_294486

            Hi Lisa,

             

               We modify config table, the soft reset does not happen again.

            But the other problem is, why UFP send PR_SWAP and not reply PS_RDY.

             

            error.JPG

            • 3. Re: CYPD4236 PR_SWAP fail
              ShifangZ_26

              Hi ,

               

              You need to check whether the hardware on your end :

              1. Whether the VBUS is discharged to <1.0V?

              2. Whether the firmware have capabilities to control 5V source on your hardware end with VBUS_P_CTRL.

              4. CCG4 have VBUS_MON pin to measure the voltage of VBUS via internal ADC.

               

              Best Regards,

              Lisa

              • 4. Re: CYPD4236 PR_SWAP fail
                falu_294486

                Hi Lisa,

                 

                   I find problem about no PS_RDY, because i didn't VBUS_P_CTRL ON.

                So the UFP success sent PS_RDY and provide 5v to laptop, but when I change to 19V, laptop is shot down.

                 

                My process is as follows;

                1. VBUS_P_CTRL  OFF, and UFP send PR_SWAP.

                2. get DFP PS_RDY than VBUS_P_CTRL  ON (safe 5v)

                3. UFP send src_cap and laptop chose 19v

                4. swap adopter to 19v (VBUS_P_CTRL still ON), than laptop shot down (i didn't see UFP send PS_RDY)

                • 5. Re: CYPD4236 PR_SWAP fail
                  ShifangZ_26

                  Hi ,

                   

                  Can you please kindly check the time between 5V to 19V with scope? It seems timeout here to caused this. You may need rise slew rate of power.

                   

                  Best Regards,

                  Lisa

                  • 6. Re: CYPD4236 PR_SWAP fail
                    falu_294486

                    Hi Lisa,

                     

                    below is 5v to 20v time about 296ms

                    slope_3.jpg

                    • 7. Re: CYPD4236 PR_SWAP fail
                      ShifangZ_26

                      Hi ,

                       

                      Please kindly decrease the time to 200ms (Of course, smaller is better) from hardware side or regulator setting. Since 250ms will hit the time out of VBUS ENABLE timer.

                       

                      Best Regards,

                      Lisa

                      • 8. Re: CYPD4236 PR_SWAP fail
                        falu_294486

                        Hi Lisa,

                         

                           i fixed this issue, is timing issue.

                        thank a lot of