I2C1 problem in STM32F401 with LSM6DSLTR
Hi,
I have custom developed board that uses STM32F401RCT6TR as MCU. I have LSM6DSLTR IMU sensor on the board and MCU is communicating with IMU using I2C1 channel (PB6 and PB7). I also have 2.4" screen (ILI9341) that displays IMU values and external EEPROM (on I2C2 channel) to store data.
I am facing problem in I2C1 (PB6 and PB7) channel. Sometimes the sensors returns correct values, but most of the times it returns weird data. I think that my library is correct because I used same library in my another board (that uses STM32F030) and it was working as expected. I have pull up resistors attached to the I2C lines. I also changed the MCU and IMU with new ones, but nothing changed and IMU not worked as expected. I think it is sth related to my code. Could you please help me to solve this issue? I have attached LSM6DSLTR library and main code to this post.
Thank you
