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.

TPS65981: Can't power role swap from peer after clearing dead battery flag

Part Number: TPS65981
Our device is a portable battery charger that charges removable batteries, and can either supply or sink power through the usb-c port. It uses the tps65981 (can provide screenshots of configuration if needed).
We're having an issue with being able to do power role swaps. I've read and reread the doc https://www.ti.com/lit/an/slva843a/slva843a.pdf which explains in which situations the swaps are able to happen. In our case, when the controller boots with a dead battery, we then switch to being powered from our external battery and clear the dead battery flag. However, in this state I'm unable to initiate a power role swap from the connected peer (in this case an android phone with a type C port). I attempt to initiate the swap from the android menu, and I see the request on the pd analyzer, but the tps rejects it. I am, however, able to use i2c to make the tps itself initiate a power role swap. Do you have any idea what could cause this asymmetry where the controller accepts power role swap commands but not requests from the peer? Note that in the non dead battery case the power role swap works in both cases.
I've triple checked all the options -- PortInfo is set to UFP snk/src with PR_swap, and process swap to sink and source are both enabled. The charger can only act as a usb device (it has a built in ftdi).
  • Hi Jerry,

    It sounds like this is expected behavior. If you do not clear the dead battery flag by the time the power role swap message is sent to the TPS65981, then the TPS65981 will reject this command. That is what I believe is occurring.

    Recommend that you proceed with the implementation where the EC sends a command to the PD controller to initiate the power role swap. Believe that this is the best overall solution for your system

  • Hi Adam,

    I'm not sure you understood my issue. There are two cases which I see

    1. Boot with dead battery flag. Clear dead battery flag. Send power role swap via host 4CC command. Success.

    2. Boot with dead battery flag. Clear dead battery flag. Peer device sends power role swap command. Rejected by TPS65981

    My issue is with #2, the swap is rejected even though i have cleared the flag

  • Hello,

    You can check the configuration of the device to see if it accepts power role swaps (register 0x29). If it is not setup to accept power role swaps, that is one potential reason why the TPS65981 would reject the power role swap

    My second question is how do you know that you are clearing the dead battery flag before the peer device sends the power role swap command? Are you using two EVM's where you control when commands are sent on both sides of the connection?

  • Yes I've checked that we accept power role swaps. The register is set correctly in application customization.

    We clear the dead battery flag immediately on boot. The peer device is an android phone which has a UI menu that allows me to send a power role swap.

  • Hi Jerry,

    I will need to check this myself to see if is an issue or not using our EVM's in a controlled environment. However this will take time as with all of the current restrictions in place due to COVID-19.

    In the mean time, I suggest continuing with your system validation till I can look at this.

    Can you share with me the project file you are programming to the TPS65981? Also, what version of the GUI you are using?

  • 2526.TPS65981.pjt

    Here is the attached project file. The version is: 

    TPS65981_2_6_7_8 Application Customization Tool

    GUI Version : 6.1.1

    Date of release : 10th October, 2019              

  • Thanks for sharing. I'll take a look at this and get back to you soon

  • Hello,

    I was finally able to test this out between two EVM's and the TPS65981 is able to receive a power role swap command following your steps outlined in the original post. Would suggest to check that a valid voltage is applied on VIN_3V3 when the power role swap command is sent, and the correct voltages are applied on the relevant power paths.

    However, in a situation like this, if your system wants to become the power source, it should be the on issuing the power role swap command. In a real situation, if a device is connected that wants to become the sink, it would immediately make that request during the PD communication, which the TPS65981 will reject since the dead battery flag has not been cleared. In your EC flow, when booting from a dead battery scenario, your EC should read the status of the connected devices, and if the conditions of the connected device match with a device you would like your system to charge, your EC would then clear the dead battery flag and have the TPS65981 execute the power role swap to become a source.