Master I2C Bus Busy

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

Master I2C Bus Busy

Jump to solution
5,059 Views
mspenard603
Contributor IV

Occasionally I see LPI2C_MasterGetStatusFlags() report Bus Busy even though SDA and SCL are high. What would cause this? And, how do I recover from the situation? As I tried to re-init I2C but it still reports bus busy.

 

0 Kudos
1 Solution
5,035 Views
mspenard603
Contributor IV

Got it. You use I2C_MasterReset() which sets the software reboot bit in MCR. Which then clears Bus Busy bit in MSR.

And you have to call I2C_MasterReset() before doing a I2C_Init()

 

View solution in original post

0 Kudos
9 Replies
2,617 Views
mspenard603
Contributor IV

I've been seeing issues myself of late. Since upgrading from SDK 2.5.1 to 2.12.1. RX and TX timeouts with the bus reporting busy. And I'm not seeing such on my scope.

0 Kudos
5,048 Views
mspenard603
Contributor IV

Yes, I've been reading through that. I tried bit-banging clock cycles via GPIO as suggested someplace. Then doing an I2C_MasterInit() and a ClearFlags() but this doesn't clear the Master Bus Busy MBF bit. How do I clear that bit?!

0 Kudos
5,054 Views
igorpadykov
NXP Employee
NXP Employee

Hi mspenard603

 

for recovering i2c one can look at hints provided on

https://community.nxp.com/t5/i-MX-Processors/I2C-reset/m-p/253182

 

Best regards
igor

0 Kudos
5,036 Views
mspenard603
Contributor IV

Got it. You use I2C_MasterReset() which sets the software reboot bit in MCR. Which then clears Bus Busy bit in MSR.

And you have to call I2C_MasterReset() before doing a I2C_Init()

 

0 Kudos
3,332 Views
ping1
Contributor V

Hi, 

I have same problem.

But inside LPI2C_MasterInit(),  LPI2C_MasterReset(base) is called first. Not sure why should user call it again. The problem for me is that after calling LPI2C_MasterInit, the bus flag set to busy. Can I call reset afterwards?

Regards!

Ping

 

0 Kudos
4,714 Views
jamesk
Contributor III

I understand the suggested approach is a workaround to the issue.

Does anyone know why occasionally LPI2C_MasterGetStatusFlags() reports Bus Busy even though SDA and SCL are high?

I also see this often enough on our dev. product which is built on using NXP iMXRT 1052.

Should this be considered as a NXP driver bug?

0 Kudos
2,705 Views
p_shep
Contributor IV

Finding this as well.

Transfer 'fails' returning bus busy, however the lines are high in between transactions as seen by a scope, and actually the transaction on the line completes properly - well, as far as the code allows since the driver is saying the transaction failed.

It also seems that once it's in this state, is can't recover on it's own. In that it's not just the occasional transaction, once it happens, it returns bus busy for ever.

0 Kudos
2,668 Views
p_shep
Contributor IV

This is a problem.

The suggestion of calling master reset, then re-initialising the bus isn't helping. The driver is still returning bus busy after resetting when both IO line are clearly high.

0 Kudos
2,665 Views
p_shep
Contributor IV
And if I step through the code with a debugger, the busy flag magically disappears and it starts working again
0 Kudos