cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103 I2C using DMA with MPU6050 got stuck after some readings?

Ansic 121
Associate II

Hi,

I am using STM32F103 interfaced with MPU6050 over I2C with DMA.

I am using CubeMX generated code.

If I simply use

 HAL_I2C_Master_Receive()

function then it works fine.

I am reading this for my quadcopter and needs faster loop time so decided to use DMA.

I generate DMA enabled code using CubeMX and use

HAL_I2C_Master_Receive_DMA()

function. but then got stuck after 5 readings with constant data.

Googled alot and tried different solution but non of them worked.

Any suggestions? What I am missing?

Thanks,

Ansic

2 REPLIES 2

>>Googled a lot and tried different solution but none of them worked.

So perhaps instead of people re-explaining methods you've already tried, you could perhaps enumerate them more specifically.

I'd recommend using a logic or protocol analyzer to better understand the mode of failure observed at the pins.

I2C+DMA on an F1is likely to be a lot of fun.

Check for error status returned by the DMA functions, or flagged by the I2C/DMA peripherals.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Ansic 121
Associate II

Unfortunately I didn't have any logic or protocol analyzer and debugger?

What can I see is just printf over UART.

It got stuck just after 5 readings