HAL Library 30- MPU6050 for STM32Fxxx

After MPU6050 library for STM32F4xx series only based on STM32F4xx Standard peripheral drivers, I’ve redesign this library for HAL support over all STM32 series. It has some more features then my first library. It can now read data from MPU6050 (obvious), set interrupts for data ready and motion detection, read interrupts status, set custom data rate for data ready interrupt and set new gyro and accelerometer sensitivities on the fly. More about lib is describe below and on HAL API site.


Read more about HAL libraries


  • Operates with MPU6050 6-axes accelerometer and gyroscope using I2C communication
  • Sets custom sensitivites on the fly
  • Enables/disables data ready and motion detected interrupts
  • Sets custom data rate
  • Up to 2 MPU devices at a time supported with different AD0 pins


  • HAL
  • TM
    • STM32Fxxx HAL
    • defines.h configuration file
    • TM I2C
    • TM GPIO

Pinout, functions and enumerations

Pinout, list of functions and its enumerations can be found on MPU6050 library API.


DAC example is available on my Github HAL repository with included hex files for all available boards. There are 3 different examples.

Download all libraries below.



Owner of this site. Application engineer, currently employed by STMicroelectronics. Exploring latest technologies and owner of different libraries posted on Github.

You may also like...