SDK 2.0 I2C driver is not properly detecting stop events when master is reading data

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

SDK 2.0 I2C driver is not properly detecting stop events when master is reading data

1,007 次查看
davidfindlay
Contributor III


I am using the SDK 2.0 I2C driver with FreeRTOS on a KL16. I am setting up as an I2C slave. I am finding that the driver is not properly detecting stop events when the master is reading data from the slave. Instead the driver continues to send data to the D register and eventually returns an NAK event.

 

Using an I2C sniffer I can see that the bus did, in fact, send a stop and moves on to communicating to the next device on the bus. For now my solution has been to remove the ifdef I2C_HAS_STOP_DETECT and force the kI2C_SlaveCompletionEvent when I know the entire packet has been read by the master. But I would rather it did not work this way.

 

The code is nearly identical to the freeRTOS I2C example.

标签 (1)
0 项奖励
回复
1 回复

801 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

Hi David,

I am sorry, but I don't think you have to remove the ifdef I2C_HAS_STOP_DETECT and force the kI2C_SlaveCompletionEvent, because the i2c slave interrupt handler sets this event when STOP flag is set, please kindly refer to the following for details.

pastedImage_1.png

and kI2C_StopDetectFlag is checked in I2C_SlaveGetStatusFlags().

Hope that helps,

Best regards,

Kan

0 项奖励
回复