cancel
Showing results for 
Search instead for 
Did you mean: 

I2C Busy flag problem

pietro2
Associate II
Posted on June 21, 2012 at 12:58

The original post was too long to process during our migration. Please click on the attachment to read the original post.
4 REPLIES 4
flyer31
Senior
Posted on June 21, 2012 at 14:14

I assume you have the STM32 as master, and connect some peripheral slaves?

In this configuration we had the problem, that it can happen from time to time, that one of the slaves keeps the SDA line low. This is a blocking situation, as then the STM32 will keep the BUSY set and does not continue. In this case, you have to give out 8 SCL clock cycles ''manually'' (directly setting the SCL port pin high/low - this does NOT work via some IIC interface command...).

Best you insert some timeout checking, and if timeout happens, you should reset IIC and do these 8 SCL ''manual'' cycles.

pietro2
Associate II
Posted on June 21, 2012 at 15:34

thanks, it's an hardware problem, because i observe these different behaviours.

1)  if i connect an oscilloscope to GPIOB pins 8 and pin9 (SCL and SDA) everything is blocked in debugging phase, if now i disconnect both pins and reconnect only the pin 9, the program goes on (i think because a START condition is simulated).

2) if nothing is connected to the board, the debug works correctly, but (normally)  it stops after waiting for an EV6 event (I2C_EVENT_MASTER_BYTE_TRANSMITTED).
harry_rostovtsev
Associate II
Posted on November 28, 2013 at 03:05

Did you ever figure our what the problem was?  I have a very similar situation on my STM32F207 with an EEPROM attached.  Reads/Writes work intermittently but if I hook up a logic analyzer, things start working fine.

Posted on November 28, 2013 at 03:12

Pull ups, termination, line capacitance?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..