MB3hel / AUVControlBoard

Vectored 6-DOF motion controller for AUVs.
https://mb3hel.github.io/AUVControlBoard/
2 stars 2 forks source link

[BUG] Sensor data stops being acquired #17

Closed MB3hel closed 1 year ago

MB3hel commented 1 year ago

Describe the bug After some time, sensor data stops being acquired (both I2C sensors).

Tested Versions v1, v2

Impacted Versions v2 (v1 impacted by a different bug with similar effect; see #16)

To Reproduce Steps to reproduce the behavior (INCLUDE WHAT BUILD CONFIGURATION USED):

  1. Run the firmware (debug and release tested)
  2. Leave it running for a while.
  3. See sensor data stop (usually after 30ish minutes)

Expected behavior Sensors don't stop working or if they do, they are recovered.

Additional context I speculate that something happens and a sensor is holding sda low. More investigation is needed using debugger to determine if i2c operations are failing. Scope could also help see if sda is held low.

MB3hel commented 1 year ago

This is basically the same thing as #16, but the way it impacts v2 is different.

Noise on the bus makes the peripheral thing another device (master) is using the bus. This makes the hardware enter a "BUSY" state (status bit for STM32F4). This usually means another master is using the bus, however there is no other master. Thus if this happens, it should be assumed to be noise (or sensor hotplug) induced. Thus, the firmware needs to recover from this state.