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.

TPS65987DDK: TPS65987D PD config: phone as host + sink (dongle as device + source)

Part Number: TPS65987DDK
Other Parts Discussed in Thread: TPS65987D, TPS6598X-CONFIG, , TPS25751, TPS65987, TPD4S311A, USB2ANY

Tool/software:

Dưới đây là bài miêu tả hệ thống mong muốn của bạn, viết bằng tiếng Anh trang trọng, rõ ràng và phù hợp để đăng lên diễn đàn kỹ thuật hoặc gửi trực tiếp đến TI Support:


Dear TI Support,

I am developing a USB Type-C dongle using the TPS65987D that needs to support the following functionality:

  • When a 5V power adapter is connected to the dongle:

    • The adapter powers the dongle.

    • The dongle charges the phone via USB-C at 5V, up to 2A.

    • At the same time, the phone must remain in USB Host (DFP) mode, and communicate with the dongle via USB 2.0 data lines (D+/D–).

  • When the adapter is not connected:

    • The dongle powers off completely (no data, no VBUS).

    • The phone must not power the dongle (to avoid draining its battery).

    • No communication should occur.

So, in short, the phone must always act as the USB Host (DFP), while also being a Sink (charging) when a 5V adapter is connected to the dongle. The dongle must never draw power from the phone.

We understand that this asymmetric configuration (DFP + Sink) is only achievable through USB Power Delivery (PD) and not through legacy CC pull-up/down.

Our intention is to:

  • Use the TPS65987D in standalone mode with SPI flash (W25Q16JV) to store the PD configuration.

  • Generate a custom PD image using the TPS6598x-CONFIG tool, with:

    • DRP enabled, but default to UFP (Device) with Source role when adapter is present.

    • Advertise PDO: 5V @ 2A.

    • Force data-role = UFP (so that the phone remains DFP for OTG communication).

    • Disable VBUS sourcing unless adapter is present.

We will program the .bin configuration file into the SPI flash using an external MCU (STM32), then connect it to the TPS65987D via SPI.

Could you kindly confirm that this architecture is valid for the TPS65987D?
Also, if possible, please approve access to the TPS6598x-CONFIG Tool so we can proceed to generate the necessary firmware image.

Thank you very much for your support.

Sincerely,
[Mr.Hiếu]


  • Hi Mr. Hieu,

    The TPS65987DDK is not recommended for new designs, and will not pass the latest PD compliance. There will also be limited support for the TPS65987DDK going forwards.

    If you only need 5V sourcing, data role swaps, and USB2 data speeds max, you may want to evaluate using the TPS25751 instead as this is an active part supporting the latest PD spec.


    So, in short, the phone must always act as the USB Host (DFP), while also being a Sink (charging) when a 5V adapter is connected to the dongle. The dongle must never draw power from the phone.

    We understand that this asymmetric configuration (DFP + Sink) is only achievable through USB Power Delivery (PD) and not through legacy CC pull-up/down.

    Our intention is to:

    • Use the TPS65987D in standalone mode with SPI flash (W25Q16JV) to store the PD configuration.

    • Generate a custom PD image using the TPS6598x-CONFIG tool, with:

      • DRP enabled, but default to UFP (Device) with Source role when adapter is present.

      • Advertise PDO: 5V @ 2A.

      • Force data-role = UFP (so that the phone remains DFP for OTG communication).

      • Disable VBUS sourcing unless adapter is present.

    Both the TPS65987 and TPS25751 will meet your requirements. There are some clarifications that need to be made regarding the (1) initial port role connection and (2) source only requirements.

    1.

    The PD spec only allows device to enter a Type-C contract in two configurations: (1) Source-DFP or (2) Sink-UFP. You cannot enter as a Sink-DFP.

    The device would need to be configured to be Source-DFP only on initial connection, and then for it to process and initiate a data role swap to UFP. If you configure the port to be DRP on connection, it may initially negotiate a Sink-UFP connection.

    2.

    Both devices support "dead battery" mode, which entails them exposing the type-C sink termination(Rd) resistors on the CC lines in an unpowered state. This means that when the dongle is unpowered, the PD controllers will connect as a sink and potentially draw power.

    When the PD controller is powered and configured to be source only, the dead battery resistors are removed.

    The only way to prevent this is to add a protection device that disconnects the CC lines in an unpowered state so that the dead battery resistors are not exposed on the TYpe-C connector.

    For example, the TPD4s311a could be used to isolate the dead battery resistors from the Type-C connector. If using the TPD4S311A, the RPD pins should not be connected to the CC lines.

    https://www.ti.com/product/TPD4S311A

    Could you kindly confirm that this architecture is valid for the TPS65987D?

    Outside of these two items, your architecture should be fine.

    I see that there is a separate thread about access to the Config Tool so will not answer that here.

    Thanks and Regards,

    Chris

  • Hi TI team,

    I'm designing a Type-C dongle using the TPS65987D together with an external SPI Flash (W25Q16JV) to operate in standalone mode, without a host MCU.

    White check mark The goal of the system is:

    • When an Android phone/tablet is connected:

      • The phone acts as a USB Host (DFP) for OTG data communication (via D+/D–)

      • The phone also receives power (Sink) from the dongle (5V @ 2A), but only when an external adapter is plugged in

      • The dongle must never draw power from the phone

    • When the external adapter is unplugged:

      • The dongle should not pull power from the phone (no dead battery sink behavior)

      • USB data and VBUS should be fully disconnected


    Gear️ Our plan:

    • Use TPS65987D in standalone boot mode with configuration stored in W25Q16JV SPI Flash

    • Generate .bin configuration using TPS6598x-CONFIG Tool

    • Configure:

      • Power Role: DRP, prefer Source

      • Data Role: Force UFP (to keep the phone as DFP host)

      • Advertise PDO: 5V @ 2A

      • Disable VBUS sourcing unless external 5V input is present

    • Dead battery behavior should be avoided (don’t allow the dongle to appear as Sink when unpowered)


    QuestionWe would appreciate if TI could provide:

    1. Any reference design, schematic, or evaluation board that demonstrates a similar configuration using TPS65987D + SPI Flash in standalone mode

    2. A sample .bin configuration (PD contract with 5V source, UFP data role, and no dead battery Sink exposure)

    3. Recommendations for CC line protection (e.g. using TPD4S311A) to physically isolate Rd resistors when unpowered

    Our goal is to implement this without an MCU, relying fully on the TPS65987D + W25Q16JV combination.
    Thank you very much for your guidance and support!

    Best regards,
    Hieu Tran



  • I am designing a system using the TPS65987D in standalone mode, with an external SPI Flash (W25Q16JV) to store the PD configuration.

    If I already have the firmware .bin file generated using the TPS6598x-CONFIG Tool (v6.1.4), I would like to know whether it is possible to use my own STM32 MCU to flash this binary file to the SPI Flash (instead of using TI's USB2ANY or TIVA LaunchPad tools).

    Question My questions:

    • Does TI officially support flashing the .bin file to SPI Flash using an external MCU such as STM32?

    • Does the .bin file require any special formatting before flashing (e.g., offset, header, alignment, etc.)?

    • Is there any official documentation (e.g., an Application Note) or procedure that describes how to manually program the SPI Flash (e.g., sending commands directly to W25Q16)?

    • Should the .bin file be written starting from address 0x000000 in the SPI Flash?

    Thank you for your guidance and support.

    Best regards,
    Hieu Tran


  • Hi Hieu Tran,

    Any reference design, schematic, or evaluation board that demonstrates a similar configuration using TPS65987D + SPI Flash in standalone mode

    The TPS65987EVM is capable of the behavior you are asking for

    A sample .bin configuration (PD contract with 5V source, UFP data role, and no dead battery Sink exposure)

    The GUI has a default DFP project. You can start with that and enable the "initiate" and "swap" to UFP bits in the Port Control register. You can modify the advertised source voltages in the Transmit Source Caps register.

    Once configured, you can generate the .bin from the GUI.

    Recommendations for CC line protection (e.g. using TPD4S311A) to physically isolate Rd resistors when unpowered

    The recommendation would be the TPD4S311A. Just power it off of the LDO3V3 pin of the TPS65987 and make sure the RPD pins on the TPD4S311A are not connected to the CC lines.

    Does TI officially support flashing the .bin file to SPI Flash using an external MCU such as STM32?

    TI's gui generates a binary file. We do not control or "officially support" the method you use to flash the SPI flash. The "flash from project" and "binary" options are only intended for the EVM. It is up to the end user to find a way to flash the SPI flash.

    Does the .bin file require any special formatting before flashing (e.g., offset, header, alignment, etc.)?

    The bin file is formatted by the GUI. Once generated, it can be loaded to the Flash as is.

    Is there any official documentation (e.g., an Application Note) or procedure that describes how to manually program the SPI Flash (e.g., sending commands directly to W25Q16)?

    There is no documentation for flashing and empty SPI flash.

    Should the .bin file be written starting from address 0x000000 in the SPI Flash?

    yes

    Thanks and Regards,

    Chris

  • Dear TI Support Team,

    I am currently working on a USB Type-C project using the TPS65987D in standalone mode with external SPI Flash. I am using the TPS6598x-CONFIG Tool (version 6.1.4) to generate the configuration binary (.bin) for the system.

    To better understand the configuration process and avoid misconfigurations, I would like to request the following resources:

    1. An official **User Guide** or **step-by-step documentation** for the TPS6598x-CONFIG Tool.
    2. Any available **application notes** related to configuring TPS65987D for standalone mode with SPI Flash.
    3. **Video tutorials** or training content (if available) demonstrating how to use the TPS6598x-CONFIG Tool effectively.

    These resources would greatly help ensure correct implementation and reduce trial and error during the configuration process.

    Thank you very much for your support.

    Best regards,
    Hieu Tran

  • Dear Chris,

    Thank you very much for your detailed response and confirmation regarding the TPS65987D configuration.

    At this time, I do not have enough time or resources to obtain and evaluate the TPS65987EVM. Therefore, I would really appreciate if you could provide a more specific and structured guideline (or step-by-step flow) to help me implement the standalone configuration using TPS65987D with SPI Flash (W25Q16JV).

    My immediate goal is to support simultaneous USB data (OTG) communication and 5V charging to the phone. For now, I plan to:

    - Connect the 5V adapter to power the system first
    - Then connect the phone (USB Type-C) afterward
    → This way I can avoid the "dead battery mode" issue, at least temporarily, until I add a proper CC protection IC (such as TPD4S311A) in the next revision.

    If there is any document, application note, or checklist describing the proper register settings, PD role behavior (Source + UFP), and flash memory structure for TPS65987D, it would be extremely helpful at this stage.

    Thank you again for your support.

    Best regards,
    Hieu Tran

  • Dear Chris,

    Thank you again for your continued support.

    While I’ve been exploring the TPS65987D and the CONFIG Tool, I would really appreciate some high-level guidance or design insight — particularly regarding **how the TPS65987D enables the phone to act as a USB Host (DFP) while still being charged (Sink)**.

    At the moment, I am still unclear on the internal PD negotiation flow that makes this asymmetric role combination (DFP + Sink) possible. Specifically:
    - How does TPS65987D present itself during the initial Type-C connection?
    - How can it advertise 5V Source power while remaining a UFP for data?
    - Does this require mandatory support of USB Power Delivery (PD) on the phone/tablet side?
    - If the phone does **not** support PD, is there any workaround to still achieve this functionality?

    I understand that using DRP mode and initiating a data role swap might allow this, but I would really appreciate if you could suggest:
    - A reference configuration or concept to build upon
    - Or an alternative architecture that may work even without full PD support from the phone

    At this point, I am still trying to fully understand how TPS65987D can coordinate this behavior in standalone mode, and I would greatly appreciate any advice or example to help clarify the system design.

    Thank you once again.

    Best regards,
    Hieu Tran

  • Hi Hieu Tran,

    App Customization Tool Users Guide: TPS6598x Application Customization Tool (Rev. C)

    Video: https://www.ti.com/video/6122862051001

    Data and power rles: https://www.ti.com/lit/an/slvaec3/slvaec3.pdf

    Any available **application notes** related to configuring TPS65987D for standalone mode with SPI Flash.

    I don't know if there is a specific note, but once you have configured the GUI with the configuration you want, use the "Binary -> Save Binary" option, and generate a "Full Flash Image". Once you have the Full Flash binary saved, use a SPI Flash flashing tool of your choice to load the image to the Flash.

    The GUI handles the flash binary structure. All you need to do is load it to the Flash after it has been generated.

    At the moment, I am still unclear on the internal PD negotiation flow that makes this asymmetric role combination (DFP + Sink) possible. Specifically:
    - How does TPS65987D present itself during the initial Type-C connection?
    - How can it advertise 5V Source power while remaining a UFP for data?
    - Does this require mandatory support of USB Power Delivery (PD) on the phone/tablet side?
    - If the phone does **not** support PD, is there any workaround to still achieve this functionality?

    I do not know of a complete document for what you are looking for, but here are some suggestions:

    Initial Type-C Connection: Port Config Register, Port Configuration Field: Set to DFP

    Advertise 5V source: Configure Transmit Source capabilities to only have a 5V PDO

    - Does this require mandatory support of USB Power Delivery (PD) on the phone/tablet side?
    - If the phone does **not** support PD, is there any workaround to still achieve this functionality?

    Connecting to the phone to get a Data UFP Power source contract requires PD. There is no workaround that I know of.

    I understand that using DRP mode and initiating a data role swap might allow this, but I would really appreciate if you could suggest:
    - A reference configuration or concept to build upon
    - Or an alternative architecture that may work even without full PD support from the phone

    Unforunately the only reference we have is the EVM. There are default projects in the GUI for DFP, UFP and DRP systems that can help get you started.

    Thanks and Regards,

    Chris

  • Dear TI support team,

    I am currently working on a project using the TPS65987D and would greatly appreciate your help reviewing the configuration I’ve made using the Application Customization Tool (v6.1.4). My main goal is to allow a phone (USB-C Android device) to act as a USB **Host (DFP)** while also receiving **power for charging (Sink)** through the same port – essentially enabling both **OTG + charging simultaneously**.

    I’ve followed the PD spec recommendation to:
    - Start with the port configured as **Source + DFP**
    - Advertise only a 5V PDO in Transmit Source Capabilities
    - Enable **Data Role Swap** (Initiate & Process Swap to UFP) so that the phone can become DFP (Host), while TPS remains the power source.

    I’ve created the `.pjt` file based on this logic, and exported a `.bin` file for flashing to external SPI flash (W25Q16JV).

    Would you be kind enough to review my `.pjt` file to see if there are any misconfigurations or optimizations needed to achieve this goal?

    Any feedback or suggestions – even small ones – would be extremely valuable to me.

    Thank you very much in advance!

    Best regards,
    [Hiếu Trầntestx.pjt]

  • Hi Hieu Tran,

    From what you described in your system, the pjt file you sent looks good.

    Thanks and Regards,

    Chris


  • I’d like to share the complete hardware setup used in my testing. I’ve attached a hand-drawn block diagram of my experimental circuit. In this setup: - The left USB-C port connects to the smartphone. - The right USB-C port is the power input (5V charging). - The TPS65987DDH is used as the core PD controller, with SPI flash (W25Q16) storing the configuration (.bin) file. - USB D+/D− lines from the smartphone are routed through the TPS to an external peripheral (e.g., a USB mouse). To avoid dead battery conditions, I always connect the power input (charger) first, then connect the smartphone. However, even when doing this in order, I noticed that the system still does **not support simultaneous charging and USB peripheral communication**. I also experimented with pulling the **CC pin on the smartphone side to GND using a 5.1kΩ resistor**, but that did not help trigger . Could you kindly help review if there’s something missing in the configuration or schematic that might prevent proper USB host behavior alongside charging? Again, I greatly appreciate your guidance and support.Dear TI team,

    Thank you very much for your time and support.

    I would like to kindly ask you to review the attached `.pjt` file I’ve configured. Based on this setup, the TPS65987D does not appear to successfully enable both charging and USB peripheral communication at the same time when connected to a phone.

    Individually, the system can either:
    - Charge the phone (power delivery works), or
    - Allow the phone to act as a USB Host and recognize a peripheral like a mouse (OTG works)

    However, when attempting to achieve both simultaneously (phone acting as Host and also being charged), it does not function as expected.

    I truly hope you could help me verify whether there is anything misconfigured or missing in the current `.pjt`8551.testx.pjt
    . Any insights or corrections would be deeply appreciated.

    I understand your time is very valuable, and I sincerely thank you for considering this request.

    Best regards,
    [Hiếu trần]








    I’d like to share the complete hardware setup used in my testing. I’ve attached a hand-drawn block diagram of my experimental circuit. In this setup: - The left USB-C port connects to the smartphone. - The right USB-C port is the power input (5V charging). - The TPS65987DDH is used as the core PD controller, with SPI flash (W25Q16) storing the configuration (.bin) file. - USB D+/D− lines from the smartphone are routed through the TPS to an external peripheral (e.g., a USB mouse). To avoid dead battery conditions, I always connect the power input (charger) first, then connect the smartphone. However, even when doing this in order, I noticed that the system still does **not support simultaneous charging and USB peripheral communication**. I also experimented with pulling the **CC pin on the smartphone side to GND using a 5.1kΩ resistor**, but that did not help trigger . Could you kindly help review if there’s something missing in the configuration or schematic that might prevent proper USB host behavior alongside charging? Again, I greatly appreciate your guidance and support.

  • Hi Hieu tran,

    Is there a difference in the pjt when the USB works, vs. when charging works?

    What changes in the system when one works vs. the others.

    For the pjt that you provided, does it consistently exhibit a specific behavior?

    If you read the status register after connecting the phone, what power role and what data role do you see the port settle into?

    Thanks and Regards,

    Chris

  • Hi Chris,

    Thank you so much for your prompt and helpful response.

    To clarify your questions:

    Is there a difference in .pjt when charging works vs. when USB data works?

    No, I used the same .pjt file for all my tests. There is no difference in firmware/config between the two conditions. The observed behavior changes depending on the physical connection sequence and the phone’s role detection.


    What changes in the system between the two working cases?

    • When I only connect the smartphone, it enters USB Host mode correctly, and a peripheral (e.g., mouse) is recognized.

    • When I only connect the 5V charger, the TPS65987D powers the phone correctly (charging works).

    • But when both are connected, especially in the order charger first, then phone, I expect the TPS to act as USB Device (UFP) while remaining as power Source, which should allow both charging and USB data to work.

      • However, only one function operates at a time — either data or power, but not both.


    What roles are observed in the status register?

    After connection, I read the Status Register via I²C. The results show:

    • Power Role: Source White check mark (as expected)

    • Data Role: Stays at DFP X (should switch to UFP to allow phone as Host)

    Even though I set:

    • Initiate Swap to UFP = TRUE

    • Process Swap to UFP = TRUE

    • Initiate Swap to DFP = FALSE

    • Process Swap to DFP = FALSE

    The data role does not change to UFP.


    Additional notes:

    • I’ve attached a block diagram in a previous message to illustrate the setup.

    • I also tried manually pulling CC to GND via 5.1kΩ resistor on phone side to simulate Rd pull, but it didn’t help.


    What I hope to confirm:

    • Whether this .pjt is sufficient to trigger data role swap → UFP after initial connection.

    • If there’s any constraint in PD spec or TPS65987D that prevents simultaneous UFP+Source behavior in this use case.

  • Hi Hieu Tran,

    Your config seems to be good, but there are cases where the PD controller can attempt a DR_Swap to UFP and the far end rejects the DR_Swap. Ideally, you would have a PD analyzer and we could see the communication on the CC lines.

    Is the phone connected to the system over a type-C to type-C cable? Are you sure that the phone supports the PD protocol?

    Do you have an EVM or another Type-C PD DRP device that you can test with?

    Could you try changing the Port Configuration to UFP only, so that the initial connection is forced to UFP? The initiate swap to source should attempt to source and charge. Report the Status fields for the power and data roles again.

    It is starting to sound like the far end is rejecting the power/data role swaps.

    Thanks and Regards,

    Chris

  • Thanks. Although my phone supports PD technology as shown in the image, I cannot charge and transfer data simultaneously. However, I tested it on a Samsung device and it worked perfectly.
    Please explain the cause and how to fix this issue.

  • Hi Hieu Tran,

    At this point, it is difficult to tell what is failing without additional logs, specifically the PD logs. Your config should be attempting to Data role swap into the desired data role, but we cannot tell if it is even attempting this correctly without the PD log. The last thing I can think to recommend is to monitor the connection status if you have an I2C controller, use the 4CC commands SWUF or SWSr to force a power role or data role swap manually. If you had a PD analyzer, we may be able to see if the phone is rejecting the role swaps.

    I did a quick test with your testx.pjt and an EVM, and the image seems to be working properly. When a phone is connected, the TPS65987 becomes the source/UFP as desired.

    Thanks and Regards,

    Chris

  • I understand that. I have tested with many phones – except for Xiaomi and Realme, most other phones like Oppo and Samsung work.
    My configuration is correct, but very few phones actually support this feature.
    Below is an image of the Samsung A35 that I tested.
    Although its specifications do not mention PD as the charging technology, this phone still supports simultaneous charging and data transmission.

     .

    You suggested that I use a protocol analyzer to monitor the role swap communication, but to be honest, I currently don't have the equipment or tools to do that.

    Instead, I used an oscilloscope to observe the signals during the connection and successful role swap with two phones – Samsung and Oppo – and I saw that both started with identical pulses.

    For other phones where the role swap failed, I only saw a very small pulse.

    I also identified a critical design issue: adding a decoupling capacitor – even just 1pF or 1nF – between CC and GND prevents any phone from detecting the role swap request.

    Another issue is that when I connect both CC pins of the TPS65987 to both CC pins of the phone, it doesn't seem to work. The functionality only works properly when one CC pin of the TPS65987 is connected to one CC pin of the phone.

    I would like to know how you configure it to increase the phone's charging power.
    In the schematic I previously sent, I configured the power source to 5V at 3A, but during testing – even when the phone battery is at 50% – the charging current is only about 1A on all the phones I tested.

  • Hi Hieu Tran,

    Please translate the message to english.

    Thanks and Regards,

    Chris

  • Hi Hieu Tran,

    You suggested that I use a protocol analyzer to monitor the role swap communication, but to be honest, I currently don't have the equipment or tools to do that.

    Instead, I used an oscilloscope to observe the signals during the connection and successful role swap with two phones – Samsung and Oppo – and I saw that both started with identical pulses.

    Unfortunately, without PD logs we really can't tell how the device is responding. Whether the PD controller is correctly sending the DR Swap requests or if the phones are rejecting them.

    I also identified a critical design issue: adding a decoupling capacitor – even just 1pF or 1nF – between CC and GND prevents any phone from detecting the role swap request.

    That is interesting and somewhat strange. We typically recommend 220-330pF of decoupling cap on the CC lines (see the TPS65987EVM), so I'm not sure why you are seeing failures here.

    Another issue is that when I connect both CC pins of the TPS65987 to both CC pins of the phone, it doesn't seem to work. The functionality only works properly when one CC pin of the TPS65987 is connected to one CC pin of the phone.

    This is expected. The CC lines are not expected to be connected directly between two USB-C ports, it is expected that a type-C cable is used. Type-C cables only conduct one CC line from end to end. The other CC line is reserved for optional cable power and does not go through the entire cable.

    I would like to know how you configure it to increase the phone's charging power.
    In the schematic I previously sent, I configured the power source to 5V at 3A, but during testing – even when the phone battery is at 50% – the charging current is only about 1A on all the phones I tested.

    We would need to check the PD log to be sure, but it could just be that the phone is only pulling 1-A. If it is a PD contract, we would be able to see what current the PD controller requests and see if requests less than what is advertised. The testx.pjt seems configured correctly to source 5V 3A for both the Type-C contract and the 5V USB-C PD contract. The only thing I would add would be to enable BC1.2 "charger advertise enable" to either CDP or DCP if you have the DP/DM pins on the TPS65987 connected to the type-C port.

    Thanks and Regards,

    Chris