I2C on STM32L151CC dies intermittently
I have a tilt sensor KX112 connected to the STM32L151CC on I2C2. It seems to work fine but at times the I2C bus comes up as busy and the sensor cannot be read. Rebooting the board solves the problem for a while but it crops up again. I am running the board on an external 16Mhz crystal but the processor is configured to run at 8Mzh. The i2c bus is configured to run at 100Khz, 7 bit address. How can i solve this issue?
Hooking up my sensor to a stm32L152 discovery board does not show bus busy but throws up AF error. I could not get the discovery board to read the sensor even once.
The same sensor connected to a STM32F091 works flawlessly.
