cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 I2C communication failure

nanayakkaraan
Associate II
Posted on May 06, 2011 at 13:16

STM32 I2C communication failure

5 REPLIES 5
greg_t
Associate II
Posted on May 17, 2011 at 14:34

Post your code

emalund
Associate III
Posted on May 17, 2011 at 14:34

read the errata, there is a lot of problems with the I²C but two workarounds are suggested

ColdWeather
Senior
Posted on May 17, 2011 at 14:34

You can take a look at

http://www.st.com/internet/com/SOFTWARE_RESOURCES/SW_COMPONENT/FIRMWARE/stm32_i2c_cpal.zip

library available on ST website.

In general, I2C peripheral in STM32F is tricky and not really successful: well minded double buffering of data register brings in fact a lot of problems, the cases for one or two bytes transmissions should be handled in a special way while the interrupts should be completely disabled, etc. I spent a week to get familiar with STM32F I2C. Be ready!
emalund
Associate III
Posted on May 17, 2011 at 14:34

read the errate. two workarounds suggested

0x00000040, as the return value of I2C_GetLastEvent(). same as me (and probably everybody else)
lowpowermcu
Associate II
Posted on May 17, 2011 at 14:34

I have found a library for I2C that I find useful to handle I2C communicatio without requiring to understand the I2C spec.

I want to share it with you and hope it helps you:

http://www.st.com/internet/com/SOFTWARE_RESOURCES/SW_COMPONENT/FIRMWARE/stm32_i2c_cpal.zip

lowpowermcu