2023-08-04 01:22 AM
Hello,
We'r trying to implement (12) VL53L1x t-o-f sensors to STMF407 Discovery Board. In our project we'r driving 2 DC motors and a dc driver. Instead we would like to run 12 t-o-f sensors on the same board. In our testing case ; after driving the motors like a minute; I2C breakdowns and because of this reason we need to reset the I2C function accordingly. And after resetting the I2C bus ; the 7 t-o-f s are starting to work correctly and the rest is no stable. One more important thing is ; the rest 5 t-o-f are the same sensors all the time. What might be the reason for collapsing of I2C bus ? And it is possible to run 2 dc motor+ driver and (12) VL53L1x t-o-f sensors on the same board.
2023-08-04 06:02 AM
I recommend putting a logic analyzer on the I2C line to understand the nature of the fault and debug from there.
In my experience, the HAL I2C libraries on the F4 are not great. Furthermore, the I2C peripheral on the F4 is insanely complicated and has race-like conditions that you need to watch out for. These can mostly be avoided by blocking I2C mode rather than interrupt or DMA mode.
If this is a large setup with long jumper wires everywhere, could be noise contributing to the problem. Hard to say without seeing the setup or the code.