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.

TPS65987D: Updating firmware through I2C in power SINK mode

Part Number: TPS65987D

Hi everyone,

I've written a firmware update program according to the flowchart and template provided by TI, my setup is a type-C port in power SINK mode (dead battery mode, as my setup is connected directly to an external charger). Here is the code:

https://github.com/mahdichi/tps65987_update_over_i2c/blob/a6a28e202b872663cc7d91b3f5c5dec8f10b865c/code/tps65987d_flash.c#L208

When the program reaches the point that disables type-C port (line 208), the board resets and update aborts. If I remove this line (disabling type-C port), the program reaches the end, but the firmware is not updated afterwards.

Can you please provide pointers on how to resolve this issue?

  • Hi Keyvan,

    With the holidays here, many device experts are currently out of the office. When they return they will look into this and provide a response. Please expect some delay accordingly.

    Thanks,
    Field

  • Hi Field,

    Are device experts back in the office? This issue is blocking an update we're trying to send to customers.

    Thanks,

    Keyvan 

  • Hi Kevyan,

    What step in the flowchart does line 208 occur at? What are you attempting to write to Port Config?

    In general, we recommend customers follow the flow chart when developing their own code, and use the pseudocode more as reference.

    Thanks and Regards,

    Chris

  • Hi Chris,

    Our code is exactly in accordance with the flowchart. Line 208 turns off the type-C port, as advised by the flowchart. But since we're using the port as the power source, with no battery in the circuit, this seems to disrupt the update process and reset the board, meaning that lines after 208 are never executed.

    We tried removing this line, i.e. not disabling type-C port at this step, the code finishes with no error, but firmware is not updated.

    I think the problem here is that our configuration is not accounted for in the flowchart (dead battery mode, the only power source is the port itself). What should we do instead of disabling type-C for the power source to not be disrupted, so that code runs until the end and update the firmware?

    Thanks,

    Keyvan 

  • Hey Kevyan,

    Do you successfully complete the FLVy command?

    Are you completing the GAID command?

    We tried removing this line, i.e. not disabling type-C port at this step, the code finishes with no error, but firmware is not updated.

    If FLVy is completing, you should have successfully updated the flash. Realize that the PD controller only updates the latest firmware on a power cycle or GAID event, so you will eventually need to power cycle the device to load the new image from the SPI FLash.

    I think the problem here is that our configuration is not accounted for in the flowchart (dead battery mode, the only power source is the port itself). What should we do instead of disabling type-C for the power source to not be disrupted, so that code runs until the end and update the firmware?

    This is a difficult question that depends on your system.

    If I understand correctly, there is a gap in time after the firmware has been loaded and before you verify the new patch is loaded to the PD controller that power is removed due to the "Port-C disable" step and due to being in dead battery.

    Is there a way you can check for the new firmware version on boot? The "reset" step in the flow chart is necessary for loading the updated flash image to the PD controller and there is no way around it.

    Thanks and Regards,

    Chris