S32K146 I2C re-initialization in slave mode

cancel
Showing results for 
Search instead for 
Did you mean: 

S32K146 I2C re-initialization in slave mode

Jump to solution
169 Views
J_W_
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

Labels (1)
Tags (2)
0 Kudos
1 Solution
159 Views
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

 

View solution in original post

0 Kudos
5 Replies
160 Views
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

 

View solution in original post

0 Kudos
139 Views
J_W_
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 Kudos
132 Views
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 Kudos
77 Views
J_W_
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 Kudos
73 Views
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 Kudos