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,011件の閲覧回数
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 返信

805件の閲覧回数
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 件の賞賛
返信