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.

CC3220SF: I2C burst count assert hit

Part Number: CC3220SF

I2CCC32XX_MAX_BURST is defined in source/ti/drivers/i2c/I2CCC32XX.c with a value of 255.

I2CCC32XX_primeReadBurst() limits burst count to this value:
 
    /* Determine the size of this burst */
    if (object->readCount > I2CCC32XX_MAX_BURST)
    {
        object->burstCount = I2CCC32XX_MAX_BURST;
    }
    else
    {
        object->burstCount = object->readCount;
    }

The value of burst count is later validated via an assert with a condition that does not match:

void
I2CMasterBurstLengthSet(uint32_t ui32Base, uint8_t ui8Length)
{
    //
    // Check the arguments.
    //
    ASSERT(_I2CBaseValid(ui32Base) && (ui8Length < 255));

    //
    // Set the burst length.
    //
    HWREG(ui32Base + I2C_O_MBLEN) = ui8Length;
}

The assert is triggered when trying to read >254 bytes. Should I2CCC32XX_MAX_BURST be set to 254 or the assert condition removed (since the data type already limits the value to range 0-255)?

SDK version 7.10.00.13.

  • Hi Charlie,

    Thanks for waiting. After an internal discussion and investigating the TRM, the assertion is incorrect. Please refer to the I2CCC32XX_MAX_BURST being 255.

    Appreciate you for pointing this out!