I needed to use Chibios in a multi-master I2C environment. I saw that the driver was not ready for it, because it assumed that you don't have to wait for the I2C bus to be free; when the bus is busy because other uC adquired the bus previously, it fails.
The solution is just to wait until busy bit is free, and take this time into account for the timeout.
I have attached the drivers with some changes; I have tested it on a very busy I2C bus, and it's able to share the bus without errors.
I2C Multimaster STM32
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times