S32K146 I2C re-initialization in slave mode

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

S32K146 I2C re-initialization in slave mode

跳至解决方案
2,397 次查看
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,387 次查看
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,388 次查看
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,367 次查看
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,360 次查看
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,305 次查看
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,301 次查看
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 项奖励
回复