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.

TPS25750: Device doesn't switch to APP mode, PATCH address is NAKed

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

Tool/software:

Dear all,

I am facing an issue with a custom charger board in which the device does not switch to 'APP' mode.

Below is the schematic along with the code snippet which handles this part.The below SW snippet works with the 'USB-PD-CHG-EVM-01' (with a different slave address of course).

SW:

[...]

#define I2C_SLAVE_ADDR 0x44
#define I2C_SLAVE_ADDR_PATCH 0x46

static void tps_StartPatching(void)
{
    uint8_t data_frame[6];
    char cmd_frame[5];

    data_frame[0] = (uint8_t)gSizeFullFlashArray;
    data_frame[1] = (uint8_t)(gSizeFullFlashArray >> 8);
    data_frame[2] = (uint8_t)(gSizeFullFlashArray >> 16);
    data_frame[3] = (uint8_t)(gSizeFullFlashArray >> 24);
    data_frame[4] = I2C_SLAVE_ADDR_PATCH;
    data_frame[5] = 0x32;

    cmd_frame[0]  = 4;
    cmd_frame[1]  = 'P';
    cmd_frame[2]  = 'B';
    cmd_frame[3]  = 'M';
    cmd_frame[4]  = 's';

    if (tps_WriteCommand(&cmd_frame[0], &data_frame[0], sizeof(data_frame))) {
        HAL_Delay(10);  // Allow TPS to process the task command

        uint8_t *patch  = (uint8_t *)(uint32_t)&tps25750x_fullFlash_i2c_array[0];
        uint32_t chunks = (uint32_t)(gSizeFullFlashArray / PATCH_CHUNK_SIZE);
        HAL_StatusTypeDef result = HAL_ERROR;
        for (int i = 0; i < chunks; i++) {
            result = HAL_I2C_Mem_Write(g_PowerM.i2c, I2C_SLAVE_ADDR_PATCH, TPS_DATA_REG, sizeof(uint8_t),
                                       &patch[i * PATCH_CHUNK_SIZE], PATCH_CHUNK_SIZE, 30000);
            if (result != HAL_OK) {
                return;
            }
        }

        if (result == HAL_OK) {
            g_PowerM.i2c_address = I2C_SLAVE_ADDR_PATCH;
            HAL_Delay(10);

            tps_ResetDataPointer();

            g_PowerM.patched = true;
            g_PowerM.offset  = 0;
        }
    }
}

[...]

'tps_WriteCommand' is accepted by device but when the actual patch is sent, the slave address, previously set in 'PBMs' is NAKed.

HW: the board is used only in sink mode.

Looking forward to hearing news from you.

Best Regards
Cosmin,

  • Hi Cosmin,

    Thank you for reaching out!

    It seems you are writing to I2C address 0x44. The I2C default slave addresses are 0x20, 0x21, 0x22, 0x23 respectively (you would need to bit shift to the right by 1)

    Please let me know if you have additional questions/concerns. 

    Best Regards, 

    Aya Khedr 

  • Dear Aya,

    There's no issue with the address (0x44 = 0x22 << 1). My HAL function requires a shifted slave address, that's why 0x44 in place. Before executing the above mentioned function, a lot of communication happens with the device (e.g detect the device mode, etc).

    I will try with another 'slave patch address'.

    Thank you,
    Best regards,
    Cosmin

  • Hi Cosmin, 

    Thank you for clarifying, the address used should be fine in that case. 

    I took a closer look at the schematic and noticed that VBUS pins are left floating. Dead-battery scenarios will not work if these pins are not connected to the Type-C connector VBUS. 

    • Pins 32 and 33 (VBUS) need to be connected to VBUS_IN. 
    • PP5V is not used since this is a sink-only application. Please tie to GND. 
    • See the following FAQ for a sink-only schematic. 

    I would also like to highlight our follow-on device, the TPS25751, recommended for all new designs. Please see the following FAQ

    Best Regards, 

    Aya Khedr 

  • Hello Aya,

    Thanks a lot for you valuable input. We already applied those modifications to the next PCB revision and hope that will fix the issue. For now, we can close this topic till we will have the chance to test again.

    Thank you,
    Best Regards,
    Cosmin

  • Hi Cosmin, 

    No problem! Feel free to open a new thread if you have further questions. 

    Best Regards, 

    Aya Khedr