Skip to main content
Ansic 121
Associate
September 4, 2018
Question

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

  • September 4, 2018
  • 2 replies
  • 801 views

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

    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    September 4, 2018

    >>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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Ansic 121
    Ansic 121Author
    Associate
    September 4, 2018

    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