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.

[参考译文] MSP430FR5729:DRIVERLIB 潜在错误:EUSCI_B_I2C_masterReceiveMultiByteFinish ()

Guru**** 2482225 points


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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1240543/msp430fr5729-driverlib-potential-bug-eusci_b_i2c_masterreceivemultibytefinish

器件型号:MSP430FR5729

我相信我在 DRIVERLIB 版本2.91.13.01中发现了一个错误。  在文件 USCI_B_i2c.c 中,函数 EUSCI_B_I2C_masterReceiveMultiByteFinish()中的 代码如下:

uint8_t EUSCI_B_I2C_masterReceiveMultiByteFinish (uint16_t baseAddress)
{


//发送停止条件。
HWREG16 (baseAddress + OFS_UCBxCTLW0)|= UCTXSTP;

//等待 Stop 完成
while (HWREG16 (baseAddress + OFS_UCBxCTLW0)& UCTXSTP)      <--注:不分号

//等待 RX 缓冲区
while (!(HWREG16 (baseAddress + OFS_UCBxIFG)& UCRXIFG));

//在由于以下原因而设置停止位之后从接收缓冲区中捕获数据
//MSP430 I2C 关键时序。
返回(HWREG16 (baseAddress + OFS_UCBxRXBUF));

我认为在 "等待 Stop to finishe"注释之后紧接着的"while (HWREG16 (baseAddress + OFS_UCBxCTLW0)& UCTXSTP)"的末尾应该有一个分号(;)。  缺少的分号使 Wait-for-stop while 语句也执行 wait-for-RX-buffer while 语句、这可能会触发 SLAZ382AH 中记录的总线停顿勘误 USCI37。  值得注意的是,EUSCI_B_I2C_masterReceiveMultiByteFinishWithTimeout() 函数在相应代码行的末尾确实有一个分号。

这似乎 会影响所有的 DRIVERLIB 版本、但 MSP430F5xx_6xx 版本除外、其中存在分号。

TI 员工能否确认?

-布赖恩

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

    Brian、您好!

    谢谢你。 我已确认并报告此问题。 它已添加到我们软件团队的待办事项中。

    此致、

    格雷戈