cancel
Showing results for 
Search instead for 
Did you mean: 

I2C STOPF flag is set in MASTER mode

greg_t
Associate II
Posted on October 06, 2010 at 19:54

I2C STOPF flag is set in MASTER mode

#i2c
6 REPLIES 6
drzile86
Associate II
Posted on May 17, 2011 at 14:10

Hi,

First,t ry to use std per library for I2C initialization. 

Second, maybe you have some hardware problem. Do you have pull-ups on I2C lines and which voltage are on this lines?  

BR,

Dragan

greg_t
Associate II
Posted on May 17, 2011 at 14:10

I found out that I have noise in my hardware resulting STOP condition

nanayakkaraan
Associate II
Posted on May 17, 2011 at 14:10

hello,

I too have try up a  similar program and the point in which my code get stuck is'

/* Test on I2C1 EV6 and clear it */

  while(!I2C_CheckEvent(I2C1,  I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED));

Can somebody figure out possible reasons for the failure?

:(

Thank you

saurabh23
Associate II
Posted on July 16, 2011 at 01:32

We too am facing the same problem as you do. We are using STM32F103R8 controller.

We tried to do timeouts and then reset the I2C bus, but that does not help it recover. We first thought it was the slave not responding but it took us a lot of time to find that the controller is the culprit. We see that the I2C is stuck up in the while loop waiting for the ack from the slave (EV6) after sending the slave address on the bus.

Could you please tell us if you have found a soultion to this I2C stuck issue.

Posted on July 16, 2011 at 02:47

Are you sure the slave is ACK'ing? and that the bus is suitable terminated.

Unbounded while loops like this are very dangerous.

Resetting the peripheral controller will NOT reset I2C slave devices, in some cases they must be clocked out of failing conditions.

Is it more/less reliable if you drop the bus speed?

If you use GPIO's in a bit-banging mode to talk to the I2C slave, is that 100% reliable?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
saurabh23
Associate II
Posted on July 19, 2011 at 00:02

The slave acks all the while when things are working. Frequently  the I2C bus gets stuck because the CPU does not write the slave address on the bus but keeps waiting for the ack from the slave for this. IT waits in the EV6 loop of the I2C driver from ST.

We tried sending q8 clock cycles to the slave to clock it out but that did not help.

So we had to try doing controller reset. We kept the deive to test for two days and found that it recovered and was running for two days. But it did reset 28 times in those 2 days. This is definitely a work around but we are not happy with having this soultion.

The bus speed is currently 100KHz. If we increase it becomes less reliable.

We have not tried out bit banging the I2C yet.