cancel
Showing results for 
Search instead for 
Did you mean: 

Clock Held Low Using DMA

BRamo.1256
Associate II

Hello everyone, im currently studying DMA on STM boards, and im trying to send I2C messages from a mcu SLAVE (arduino) to STM32F407VET6 master, but both SCL and SDA lines is held low, it doesn´t happen when im using I2C in polling or interrupt mode, only with dma. There is something that i have to change in arduino code when im using dma?

Below some configurations that i made:

main.c

0693W000001qj1qQAA.png

0693W000001qj1vQAA.png

0693W000001qj20QAA.png

0693W000001qj2FQAQ.png

msp.c

0693W000001qj25QAA.png

arduino code (this code is used for i2c in polling mode and dma mode)

0693W000001qj4LQAQ.png

2 REPLIES 2
BRamo.1256
Associate II

Just to explain, the timer controls when the i2c will request data from arduino.

BRamo.1256
Associate II

I forgot to implement I2C1_EV_IRQHandler so when one step was completed by the i2c peripheral, the i2c did not warn the dma, and the dma does not continue, the first stage that was to clear SB and load slave address was not performed. Now its working.