Skip to main content
MHell.1
Associate II
May 7, 2020
Solved

IC2 detection problem after uploading code / reset

  • May 7, 2020
  • 5 replies
  • 1577 views

Hello,

I have connected a BNO055 Sensor via I2C to a STM32WB Nucleo board. The sensor data is send by a BLE Service without problems after powering the device.

However, if I change the code and upload via STM32CubeIDE or press the reset button on the device, the I2C connection seems broken... I do receive a HAL error from time to time...

Question: is there a way to securely reset all pins apart from pressing RESET or is this more likely to be my software's problem?

This topic has been closed for replies.
Best answer by TDK

One problem with I2C is that the protocol requires other devices to behave correctly. If one is misbehaving, resetting the MCU won't help.

> is this more likely to be my software's problem?

If you're getting a "HAL error from time to time", I would suggest tracking those down. This is not normal and indicative of an issue somewhere.

> is there a way to securely reset all pins

You can reset pins and peripherals one at a time. There is no single function call to "reset all pins".

5 replies

TDK
TDKAnswer
Super User
May 7, 2020

One problem with I2C is that the protocol requires other devices to behave correctly. If one is misbehaving, resetting the MCU won't help.

> is this more likely to be my software's problem?

If you're getting a "HAL error from time to time", I would suggest tracking those down. This is not normal and indicative of an issue somewhere.

> is there a way to securely reset all pins

You can reset pins and peripherals one at a time. There is no single function call to "reset all pins".

"If you feel a post has answered your question, please click ""Accept as Solution""."
waclawek.jan
Super User
May 7, 2020

You may want to start with implementing the "9 SCL pulse" reset sequence before starting any I2C communication - see the I2C standard and search this forum.

JW

MHell.1
MHell.1Author
Associate II
May 19, 2020

The Problem indeed was an error in the sensor's firmware.

waclawek.jan
Super User
May 19, 2020

You mean inside the sensor? Can you please elaborate on this? How did you solve the problem?

JW

MHell.1
MHell.1Author
Associate II
May 19, 2020

I just prevented the chip from resetting, since the FW-Update has not been available as far as I know.

Here's the issue: https://community.bosch-sensortec.com/t5/MEMS-sensors-forum/BNO055-power-on-reset-issues/m-p/8457/highlight/true#M948

waclawek.jan
Super User
May 19, 2020

Huh...

Thanks for this piece of information.

JW