I2C FIFO TX issue

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

I2C FIFO TX issue

跳至解决方案
1,128 次查看
ping1
Contributor V

Dear all

I am using RT1024,  I2C has issues, the communication sequence is 

1. Send  LPI2C_MasterStart(Base, I2C_Status[chn].SlaveAddr, kLPI2C_Write)

2. Calling LPI2C_MasterGetFifoCounts(Base, NULL, &txCount); to get txCount, if txCount>0 then wait until it is 0, otherwise carry on check LPI2C_MasterGetStatusFlags(Base) & kLPI2C_MasterNackDetectFlag , and further operation.

 

It usually work fine, but sometime I found that Step 2 stays in the state forever as it always get 1 for txCount although waited for some time. Then software locks there forever.

Could somebody tell me how to solve the problem? in step 1 the FIFO txCount is 0 before sending, how can it sending forever?

what is the way to recover please?

Thank you!

Ping

0 项奖励
回复
1 解答
1,043 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, I suggest reviewing the example in the SDK for the board EVK and comparing if you have the same configuration.

Best regards,
Pavel

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,091 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, my name is Pavel, and I will be supporting your case, but I what to know the example that you are using and the steps to reproduce this issue.

Best regards,
Pavel

0 项奖励
回复
1,060 次查看
ping1
Contributor V
Hi, Pavel
Thanks for reply, don' think I can repeat the issue with EVK, it is our customer boards, I found that the issue happens after slave clock stretch, and master send wrong slave address afterwards, and can only be recovered after a master reset and reinit the I2C.
Now have another issue, in receiving function LPI2C_MasterReceive(), I noticed it stays in do while loop forever sometimes, not sure there is any way to let it not blocking, thinking of having a receive timeout there. Any suggestions? or other functions, I am not using RTOS.

Regards!
Ping
0 项奖励
回复
1,044 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, I suggest reviewing the example in the SDK for the board EVK and comparing if you have the same configuration.

Best regards,
Pavel

0 项奖励
回复