2022-05-18 11:48 PM
Hi, I've been working with my STM32F411CEU6. I connect my STM with BNO055 IMU sensor that use I2C as its communication protocol. Every time I press the reset button, the program should've start from the beginning, but in my case, that doesn't seem to work all the time. Sometime when I press the reset button, the IMU reading successfully started from the beginning (I can say that because I can see the reading result from the serial monitor). But in most cases, when I press the reset button, the program doesn't restart and the program stopped working instead. Whenever the program stopped working, I have to unplug and re-plug the USB (to my laptop) first in order to make the program able to work again.
Before using STM32F411CEU6, I use STM32 Nucleo 32 L432KC as my MCU, and this problem never happens, the program ALWAYS successfully start from the beginning.
Is this problem has to do with my hardware or is the problem located on my program? Thank you
2022-05-19 12:10 AM
Check what exactly happens when "the program doesn't restart and the program stopped working instead". Either by step-by-step debugging or flooding your code with logging output.
When the MCU is reset in the middle of a I2C communication, the BNO055 might be in some state that prevents continuing I2C comm. Are you sure that you init BNO055 completely?
There is a recommended procedure to reset I2C bus before doing any comm. You might get the idea from https://www.i2c-bus.org/i2c-primer/analysing-obscure-problems/blocked-bus/ or, better, the official specs.
hth
KnarfB
2022-05-19 06:12 AM
"or, better, the official specs"
2022-05-20 11:01 PM
Thank you for your help guys, appreciate it very much
2023-10-31 09:44 AM
I know I'm 5 years late, but I just wanted to add a couple of comments.