Skip to main content
pietro2
Associate III
June 21, 2012
Question

I2C Busy flag problem

  • June 21, 2012
  • 4 replies
  • 951 views
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.
    This topic has been closed for replies.

    4 replies

    flyer31
    Senior
    June 21, 2012
    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
    pietro2Author
    Associate III
    June 21, 2012
    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
    November 28, 2013
    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.

    Tesla DeLorean
    Guru
    November 28, 2013
    Posted on November 28, 2013 at 03:12

    Pull ups, termination, line capacitance?

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