I2C FIFO TX issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I2C FIFO TX issue

Jump to solution
828 Views
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 Kudos
1 Solution
743 Views
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

View solution in original post

0 Kudos
3 Replies
791 Views
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 Kudos
760 Views
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 Kudos
744 Views
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 Kudos