I2C Multimaster STM32

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general. This forum is NOT for support.
Post Reply
joaquin
Posts: 49
Joined: Sat Jan 22, 2011 8:44 pm
Has thanked: 1 time
Been thanked: 3 times

I2C Multimaster STM32

Post by joaquin »

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.
Attachments
I2C Multimaster.zip
(12.66 KiB) Downloaded 524 times
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: I2C Multimaster STM32

Post by Giovanni »

Hi,

Thanks, putting this in queue.

Giovanni
Post Reply