AnsweredAssumed Answered

STM32F4 I2C issue - solved

Question asked by pavelm on Mar 20, 2015
Latest reply on Mar 20, 2015 by pavelm

we are migrating our device from STM32F1 to F4 (415RGT6).
Basically wiring is very similar, connected peripherals too.

We have one device that communicating over I2C bus, but with same code it is unable to work with new processor.
Of course, there are some differences - I2C3 instead of I2C2, etc. It should work, but does not.

Initialization code looks like this:

It seems that I can get WHOAMI response from I2C device, so connection is working somehow. Then I can write some data to it.
But then I am getting:
I2C_GetFlagStatus (I2C_MPU6050, I2C_FLAG_BUSY)
so it is always BUSY after lets say 1 read and 1 write.

My I2C code is able to reset whole I2C and communication but it does not help. Whats more there shouldn't be any BUSY flag.

In this state, I2C register SR1 has value 0x44 and SR2 value 0x3.
SR1 value means:
flags are present.

SR2 has probably:
if I am correct.

I use HSE 8Mhz crystal @ 168Mhz core clock, Flash Latency 5.
There are Pull Up resistors 4K7 for SDA and SCL.

What could be wrong?

Thank you very much