cancel
Showing results for 
Search instead for 
Did you mean: 

Are multiple I2C devices with circular buffers and DMA on one i2c bus possible

DAlbe.4
Associate

We have 2 devices on one I2C port. We require fast DMA RX for high data throughput. We use circular buffers to shadow the FIFO on each device. We do this all the time with one I2C device. Two devices on the same I2C line seems impossible using the STM32WB5MMMGHx MCU. There is really no way to determine when the first DMA RX is complete. With a circular buffer CNDTR is not usable as an interrupt. If you have done this before and have a solution we would appreciate a comment.

2 REPLIES 2
Sarra.S
ST Employee

Hello @DAlbe.4​ and welcome to ST Community,

Try using multimaster mode which allows multiple devices to share the same I2C bus and each device must be configured to act as both a master and a slave and the set up the DMA circular buffers for each device, as you have done before!

Hope that helps!

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

DAlbe.4
Associate

Thanks but I am not sure that mult-imaster affords the solution. I failed to mention that the bus has one master(STM32) and two slave devices on the one I2C port. Each slave has different data types and different size fifos. DMA is a must since we cannot block during the reception of data for either device. It is the DMA that is the issue not the I2C. We need two DMA channels for one I2C bus that have separate NDTR registers. Each NDTR is a pointer into the two separate circular buffers.

However if you think that multi-master mode with one master may allow us to have multiple DMA channels then please provide an explain at the peripheral register level. I2C, DMA and DMAMUX.