cancel
Showing results for 
Search instead for 
Did you mean: 

I2C DMA stall

Lee3
Associate III

I'm configuring i2c with dma using the registers directly. I'm sure I have an error somewhere but I don't have a great idea on where to go next with debugging. Sometimes my i2c transfer goes through expediently, but sometimes it has a long stall after the address portion. Currently dma is only being used for this one peripheral. In the below scope trace, the purple is a gpio set in my function where the dma is set up, followed by an i2c start. I don't see how it could wait for 60 us before sending the data. Does anyone have any ideas what might cause this or where to look?

0693W00000FA9SEQA1.pngMy i2c clock and apb clock are both set to 170 MHz. There is a note in the errata about i2c stall, but it doesn't seem to apply.

1 ACCEPTED SOLUTION

Accepted Solutions
Lee3
Associate III

Thanks for the help. Per your comment I did try the two boards comdma, though I couldn't quite get it to work right with the toolchain that I tried. So I looked more at the original problem and realized that it was the device that was doing clock stretching not the stm32.

0693W00000FAHOyQAP.png

View solution in original post

2 REPLIES 2
Imen.D
ST Employee

Hello @Lee,

I advise you to check and compare your code/config with the I2C example available under STM32CubeG4 MCU package, to use I2C via DMA, like this one:

\STM32Cube_FW_G4_V1.4.0\Projects\NUCLEO-G431RB\Examples\I2C\I2C_TwoBoards_ComDMA

Have a look also at this FAQ "STM32 I2C does not work", which describes few tips related to I2C peripheral on STM32 devices.

When your question is answered, please close this topic by choosing Select as Best.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Lee3
Associate III

Thanks for the help. Per your comment I did try the two boards comdma, though I couldn't quite get it to work right with the toolchain that I tried. So I looked more at the original problem and realized that it was the device that was doing clock stretching not the stm32.

0693W00000FAHOyQAP.png