cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F405 having trouble with reading data from BNO055 via I2C protocol

smhn24
Associate II

Hi everyone, we are using stm32f405rgt6 microcontroller in our robot, when we are using i2c for reading data from BNO055 module suddenly the device get out of the i2c line or maybe can not read the data,

Here are some more details:

we pulled up our i2c lines with 10k resistors.

And this photo that I mentioned is our BNO055 module:


_legacyfs_online_stmicro_images_0693W00000bhiSNQAY.png 

Also, I configured the I2C2 with the following details:


_legacyfs_online_stmicro_images_0693W00000bhiSwQAI.png 

However we didn't have this problem with stm32f103c8t6 microcontroller before.

3 REPLIES 3
Foued_KH
ST Employee

Hello @smhn24​ ,

Try to use an Oscilloscope to see the SDA and SCL behavior.

If nothings appears, please check the error flags set in the status register, get the error (HAL_I2C_GetError)

Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

smhn24
Associate II

Thanks for your responsing, we check our I2C lines with logic analyzer device and we tested our I2C lines when the I2C start and our module sent data but suddenly after many reset the microcontroller, I2C did not start anymore and we must to turn off the power and back on to working again.

Is there any way to find out our I2C start well or not?

However, we suspect that both SCL and SDA lines remain high or low and don't let MCU start I2C.

Here is our data log before this happens:


_legacyfs_online_stmicro_images_0693W00000bhka9QAA.png 

Also we check (HAL_I2C_GetError) and always returns zero

If nothings appears, please check the error flags set in the status register.

 If the error is :

  • OVR, ARLO, NACK : you can just do a Transmit again
  • BERR : You have to re-enable the peripheral

 Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.