S32K146 I2C re-initialization in slave mode

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K146 I2C re-initialization in slave mode

ソリューションへジャンプ
2,467件の閲覧回数
james-lee
NXP Employee
NXP Employee

Hello team,

 

Mobis is using the LPI2C module as a slave mode, and recently faced an I2C fault during the vehicle test. So they asked how to re-initialize the LPI2C module  only in this failing case. Please let me know if the sequence below is enough or it needs further sequence.

  1. Execute the LPI2C_DRV_SlaveDeinit() function

  2. After then, execute the LPI2C_DRV_SlaveInit() function.

Can all error flags be cleared by those sequence?

 

Please let me know if you have another solution to clear the error and to recover from the LPI2C error state.

 

Best regards,

James

ラベル(1)
タグ(2)
0 件の賞賛
返信
1 解決策
2,457件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hello James,

It depends on what the error is.

Because the bus can be kept low by another device on the bus.

But if the issue is in the S32K146 LPI2C module, the procedure you described clears it.

Because the LPI2C_DRV_SlaveInit() function calls LPI2C_Init() that resets the LPI2C logic.

danielmartynek_0-1614942122876.png

 

Regards,

Daniel

 

元の投稿で解決策を見る

0 件の賞賛
返信
5 返答(返信)
2,458件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hello James,

It depends on what the error is.

Because the bus can be kept low by another device on the bus.

But if the issue is in the S32K146 LPI2C module, the procedure you described clears it.

Because the LPI2C_DRV_SlaveInit() function calls LPI2C_Init() that resets the LPI2C logic.

danielmartynek_0-1614942122876.png

 

Regards,

Daniel

 

0 件の賞賛
返信
2,437件の閲覧回数
james-lee
NXP Employee
NXP Employee

Hi Daniel,

 

Thank you for your answer.

May I ask one more thing? In the S32SDK S32K146 user manual, I found the description below at the page 648.

J_W__0-1615170722103.png

Would you please explain the reason of description marked as yellow? Because the LPI2C_DRV_SlaveInit() function can be executed during the transfer from the master in customer's application, they requested us to make sure it.

 

Best regards,

James 

0 件の賞賛
返信
2,430件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi James,

Without the init function the LPI2C module can't be used.

It is the customer responsibility to make sure the module is initialized before the master starts the transfer.

 

Best regards,

Daniel

 

0 件の賞賛
返信
2,375件の閲覧回数
james-lee
NXP Employee
NXP Employee

Hi Daniel,

 

If the I2C slave init function is executed during the master transfer, the S32K146 would receive the frame from a middle of it. So customer plans to clear the interrupt flags for the 1st frame after the slave init function. Do you think it can be a solution?

 

If not, please let me know what they need to do further.

 

Best regards,

James

0 件の賞賛
返信
2,371件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi James,

This is really application-dependent.

If they can lose the first transfer, then, I guess it can be done like that.

Or they can either delay the master or somehow notify the master that the slave is initialized and ready to receive the transfer.

 

Best regards,

Daniel

 

0 件の賞賛
返信