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.

USB-PD-CHG-EVM-01: Device Start "APP " Mode Without Flashing

Part Number: USB-PD-CHG-EVM-01
Other Parts Discussed in Thread: TPS25750, BQ25798, BQ25792

Hi,

I am trying to use STM32 board to program the device. While trying to program it, I wrote the necessary codes to follow the diagram on page 53 of the TPS25750 User Guide document. My ADCINx pins are set to 5 and 5 so it is AlwaysEnableSink index #2. When I follow the diagram, I read the INT_EVENT1.ReadyForPatch bit as 1 at the beginning. However, when I come to the next READ MODE state, I receive "APP" data when I should see "PTCH". I waited for minutes using the 10ms delay command, but the device does not exit the "APP" mode. When I check the INT_EVENT1.PatchLoaded bit, I see the value 0. Therefore, since the patch is not loaded to the device by the MCU, I see that the patch is not loaded from the EEPROM. Since the ADCINx pins on the USB-PD-CHG-EVM-01 board are set to 1.5V by the pcb, I cannot put the device into NegotiateHighVoltage mode using the ADCINx pins and therefore I cannot use the "GO2P" command. Even if I constantly cut off the power of the device and reset the device, I see that it is always in "APP" mode.

1) How can I get rid of this problem?

2) If I need to erase EEPROM, how can I erase EEPROM? Can you share a sample code blog on this subject? Because when I filled in DATA1 for the "I2Cw" command as follows, when I set CMD1 to "I2Cw" and followed the TPS25750 master line with an oscilloscope, I realized that the correct data was not circulating on the line.

data1.SlaveAddrforTransaction = 0x50;
data1.NumberofBytesforTransaction = 10;
data1.RegisterOffset = 0;

data1.Payload_Data1 = 0xFF;
data1.Payload_Data2 = 0xFF;
data1.Payload_Data3 = 0xFF;
data1.Payload_Data4 = 0xFF;
data1.Payload_Data5 = 0xFF;
data1.Payload_Data6 = 0xFF;
data1.Payload_Data7 = 0xFF;
data1.Payload_Data8 = 0xFF;
data1.Payload_Data9 = 0xFF;
data1.Payload_Data10 = 0xFF;

  • Also I noticed that I forgot to share my data1 structure. You can find the structure below:

    typedef struct{
    uint8_t SlaveAddrforTransaction:7;
    uint8_t Reserved1:1;
    uint8_t NumberofBytesforTransaction;
    uint8_t Reserved2;
    uint8_t RegisterOffset;
    uint8_t Payload_Data1;
    uint8_t Payload_Data2;
    uint8_t Payload_Data3;
    uint8_t Payload_Data4;
    uint8_t Payload_Data5;
    uint8_t Payload_Data6;
    uint8_t Payload_Data7;
    uint8_t Payload_Data8;
    uint8_t Payload_Data9;
    uint8_t Payload_Data10;
    uint8_t Reserved3;
    uint8_t Reserved4;
    uint8_t Reserved5;
    uint8_t Reserved6;
    .
    .
    .
    uint8_t Reserved51;
    uint8_t Reserved52;
    uint8_t Reserved53;
    }DATA1_I2Cw_Input_Reg_t;
  • Hi,

    Are you trying to directly program the EEPROM or TPS25750?

    The flow chart on page 53 of the TRM is PBMx and is only achievable when the ADCINx is set to negotiate high voltage and no EEPROM.

    Regards

  • Hi Tommy,

    Thank you for your response. I'm trying to program the TPS25750 with I2Ss pins but also I tried to write the patch to EEPROM and I successed it. But this time when I set the charging current to 1.5A, I measured the current that going to battery is 1A constantly. I tried 2A and etc but my charging current still same. I also read REG03_Charging_Current_Limit register of BQ25798 but I get 0 all the time.

  • Hi,

    Can you provide your .json file and capture the I2C communication between TPS25750 and BQ25798, and between STM32 and BQ25798 in the same capture?

    Regards

  • Hi,

    {"questionnaire":{"version":"7.0.3.13","answers":[4,null,2,null,3,3,1,null,1,null,0,8.4,1.5,0.4,0.4],"options":{},"configID":"0000","vendorID":"0000"}}

    This is my JSON file. I can read BQ25792(sorry for previous mistake) registers but I use STM32 for erase the EEPROM and write the patch that generated full flash binary .c file from GUI after your previous comment.

  • Hi,

    Can you confirm the TPS25750 is loading the new configuration you flashed with STM32? Are you still seeing the charge current register being overwritten?

    Regards

  • Hi,

    I'm not trying to program TPS25750 by using the STM32. I'm trying to write the patch file(.c) to EEPROM using STM32 and then I remove the battery and cut the energy on the board. Then I connect the battery again and check the registers but I see that int_event1.readyforpatch = 0, int_event1.patchloaded = 0, int_event1.I2CMasterNACKed = 1, mode = 'PTCH', boot_status.I2cEepromPresent = 1 so TPS25750 and BQ25792 are not configurated as my configuration.

  • Hi Myron,

    What ADCIN settings are you using? Can you share a schematic with the ADCIN resistors?

    I'm trying to write the patch file(.c) to EEPROM using STM32 and then I remove the battery and cut the energy on the board.

    How are you managing to do this? Is the I2C EEPROM directly connected to the STM32 and you are writing the .c file directly to the EEPROM?

    When programming the EEPROM directly, you should be using the .bin file. If you are programming the PD controller over I2C, you should use the .c file.

    Thanks and Regards,

    Chris

  • Hi Christopher,

    What ADCIN settings are you using? Can you share a schematic with the ADCIN resistors?

    My ADCIN1 pin is powered by 1.5V so its value is 5 and ADCIN2 pin is same with ADCIN1. Therefore my Dead Battery Configuration is "AlwaysEnableSink". This 1.5V fixed for the USB-PD-CHG-EVM-01 board so I cannot change it.

    How are you managing to do this? Is the I2C EEPROM directly connected to the STM32 and you are writing the .c file directly to the EEPROM?

    I create the patch file(.c) by using the GUI and I'm trying to write this patch using TPS25750 I2C master bus. I use I2C_SDA and I2C_SCL pins(for ex. Aardvark Header) at page 6 of the document(https://www.ti.com/lit/ug/tiduey1a/tiduey1a.pdf?ts=1701243200398&ref_url=https%253A%252F%252Fwww.ti.com%252Ftool%252FUSB-PD-CHG-EVM-01). So I directly connected with EEPROM.

    When programming the EEPROM directly, you should be using the .bin file.

    How can I send the bin file using STM32 to EEPROM? I tought that I have to send the array that name is "tps25750x_fullFlash_i2c_array" inside the .c patch file and I write this array into the EEPROM.

  • Hi Myron,

    Are you writing directly from the STM device to the EEPROM, or are you using the PBMx commands?

    Thanks and Regards,

    Chris

  • Hi,

    Are you writing directly from the STM device to the EEPROM, or are you using the PBMx commands?

    I'm writing directly from the STM to the EEPROM.

  • Hi Myron,

    I have not written to the PD EEPROM directly using an MCU before, so this recommendation may not be 100% accurate.

    Typically, when programming the PD controller over I2C, the MCU will use the .C file.

    When we write to the EEPROM directly, we use a EEPROM flash device (i.e. a totalphase Aardvark or a Dediprog. We are not recommending you use these, just using these as an example) which requires the full flash .bin file, not the .c file. I would recommend trying the .bin file when flashing the EEPROM directly.

    Thanks and Regards,

    Chris

  • Hi Christopher,

    I solve my problem by using a USB2I2C device like your advices. I don't know why STM32 doesn't work but right know I think flash device is an only option.

    Thanks for helping.

    Best regards.