This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TPS65988: DRP device swaping from UFP and DFP

Part Number: TPS65988

I have configured the controller to be a DRP. I was wondering why it wont let me switch roles on the fly with the SWDF or the SWUF. I am getting a 0x5 returned (unknown). What does the 0x5 mean? I have attached a image. The device I'm talking to supports both roles its a Samsung s9. I can initiate into either role but once initiated it wont ever switch at runtime to the other role. I have read threw SLVA843A a couple of time to verify the conditions for switching are met and they seem to be. It is a little confusing since I think its reference a older config tool when it uses words like "The Port Information field in the System Configuration register" i believe what it is referring to is the Port Configuration 0x28 register the port configuration field. 

v/r

Carlson Magina

TacPan_SW_PD_config_dual.pjt

  • Carlson,

    0x5 means the SWDF task has been rejected due to role-swap not supported currently by the PD controller. Which happens if any of the following conditions are true:

    • The UFP previously indicated via Sink or Source Capabilities that it does not support Dual-Role Data
    • Retimer Firmware update mode is currently active on the port
    • The port is already the DFP

    From your description, I think condition 1 is not the case. I do not know if either of the other two conditions are. But please check if Port Control (0x29) has the 'Process Swap to DFP' enabled.

    Thanks,

    Chris

  • according to the tech ref manual 0x5 is reserved i thought reject was 0x3

    The process swap is enabled. also attached are the received source and sink capabilities both indicate dual role.

    please advise.

  • 0x4-0x7 are reserved for task-specific error codes like above.

    The 'Initiate Swap to UFP' will happen everytime the PD is a DFP. Try disabling that.

  • can i get access to those error codes?

    so using an aardvark i unchecked the   'Initiate Swap to UFP' and then unplugged and plugged the phone back in just to reset the negotiation and it still returns the 0x5 error. in unplugging the phone the setting stayed. i understand the the setting change is only in ram and on the next reboot it will be set again. What's interesting is that it remunerated as a UFP by default which is why i needed to have the initiate "swap to ufp" was checked for.

    let me also note that this pd controller is being loaded by a microcontroller at boot, not sure if that matters just feels relevant cause of the second bullet about the firmware update mode

  • I have sent you a friend request to discuss the error code information. Could you capture two things for me to debug this further:

    1) In Debug Mode, plug in the phone and then in the GUI top menu click Debug -> Take Snapshot and attache the output to this issue.

    2) If you have access to a PD Analyzer could you capture the PD traffic between the phone and the device?

    Thanks,

    Chris

  • ok attached is a zip that has the snapshot output and a total phase PD analyzer capture. Let me know what you can find.

    Thanks

    Carlson Magina

    .s9_connected_snapshot.zip

  • Thanks! A few things to try:

    Set the following to false in Port Control:

        Process Swap to UFP             True (0x1)
        Initiate Swap to UFP            True (0x1)

    In Tx Identity (0x47):

    Set Product Type (DFP) to PDUSB Host

  • so that phone comes up by default as a dfp. and the swap to ufp fails 0x5 and the dfp fails 0x5. attached snapshot and pd capture

    s9_connected_snapshot2.zip

  • Carlson,

    I do see from the new PD logs that the TPS65988 is the UFP but not requesting to be DFP. I will begin setting something up on an EVM to replicate the issue with a Samsung phone (should be similar behavior as s9). I will get back to you about this on Monday.

  • Carlson,

    I was able to use your PJT on a TPS65988EVM and a Samsung S20 and successfully swap to DFP. I had to disable Initiate Swap to UFP though.

    My next question for you is to do the following:

    Please capture the Status register (0x1A) After the following actions:

    • Once the Samsung S9 phone is plugged in (before SWDF command)
    • After SWDF command is sent

    Port Control

    Status Register (before SWDF)

    SWDF Command Success

    Status Register (after SWDF)

    I did notice the command was rejected with 0x5 whenever the TPS65988 is already in DFP mode.

  • yea that worked. i can switch back and forth from UFP and DFP with no issue. I would like for this to default to UFP when ever a device is connected that's why i had the initiate UFP. i have a micro and could monitor current and then send the switch SWUF when ever current is detected. but I'm curious is there a way to always try ufp first. it looks like out of ten tries it defaults to DFP.

  • You could set the Port Configuration (0x28) -> Port Configuration to UFP so it will always default to UFP. But this will stop the PD from operating as a DRP. I think the issue is the phone usually defaults to a UFP so there is little to be done when connecting to a phone.