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 突发计数将 HIT 置为有效

Guru**** 3001220 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1651001/cc3220sf-i2c-burst-count-assert-hit

器件型号: CC3220SF

在 source/ti/drivers/i2c/I2CCC32XX.c 中定义了 I2CCC32XX_MAX_BURST、值为 255。

I2CCC32XX_primeReadBurst() 将突发计数限制为该值:
 
    /* Determine the size of this burst */
    if (object->readCount > I2CCC32XX_MAX_BURST)
    {
        object->burstCount = I2CCC32XX_MAX_BURST;
    }
    else
    {
        object->burstCount = object->readCount;
    }

突发计数的值稍后通过断言进行验证、条件不匹配:

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;
}

当尝试读取大于 254 个字节时、将触发断言。 是否应将 I2CCC32XX_MAX_BURST 设置为 254 或删除置位条件(因为数据类型已将值限制为 0-255 范围)?

SDK 版本 7.10.00.13。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Charlie、

    感谢您的等待。 在进行内部讨论并调查 TRM 后、该断言不正确。 请参阅 I2CCC32XX_MAX_BURST 为 255。

    感谢您指出这一点!