Use STM32 as I2C Slave with DMA

Post here first, or if you can't find a relevant section!
Post Reply
jenspogo
Posts: 30
Joined: Mon Feb 24, 2020 10:42 am

Use STM32 as I2C Slave with DMA

Post by jenspogo »

Hey guys :)

I had an working system with an raspberry pi Master and an STM32F103 slave which collects data from other slaves via another I2C bus. I have done over 6000k measurements. I just added a few temperature sensors and it kills a lot of timing. To overcome this problem, I would like to use DMA for the raspberry-STM connection. I have seen the SPI DMA example and it seems not to be that easy.

has anyone did that with I2C? And does it work with the STMf103?

Greets, Jens
User avatar
fpiSTM
Posts: 1746
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Use STM32 as I2C Slave with DMA

Post by fpiSTM »

Which core you used ?
jenspogo
Posts: 30
Joined: Mon Feb 24, 2020 10:42 am

Re: Use STM32 as I2C Slave with DMA

Post by jenspogo »

I'm still a little bit confused by the cores, but it should be the official ST Core from https://github.com/stm32duino/BoardMana ... index.json
User avatar
fpiSTM
Posts: 1746
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Use STM32 as I2C Slave with DMA

Post by fpiSTM »

Currently DMA is not used for I2C.
If you want use it you will have to implement it yourself using the HAL/LL directly.
jenspogo
Posts: 30
Joined: Mon Feb 24, 2020 10:42 am

Re: Use STM32 as I2C Slave with DMA

Post by jenspogo »

Hey :) thank you for your reply!
I think, that goes beyond my programming skills...
Is there a plan to implement this feature?

Greets
ag123
Posts: 1657
Joined: Thu Dec 19, 2019 5:30 am
Answers: 25

Re: Use STM32 as I2C Slave with DMA

Post by ag123 »

normally i2c is well below 1Mbps. Hence, dma is hardly used, i'd guess.
i'd think spi may be more appropriate if you'd like to try using dma.
but i've not tried playing with slave modes.
i think for slave mode, it may require falling back to HAL rather than arduino api as well.
Post Reply

Return to “General discussion”