// the find
leech001/MPU6050
STM32 HAL library for GY-521 (MPU6050) with Kalman filter
A small STM32 HAL wrapper around the MPU6050/GY-521 IMU that reads raw accel/gyro values over I2C and layers a Kalman filter on top to spit out filtered pitch/roll angles. It's aimed at hobbyists doing CubeMX-generated STM32 projects who want tilt angles without writing their own filter math.
The Kalman filter implementation (borrowed from TKJElectronics' well-known Arduino port) is a real addition over the dozens of bare register-read MPU6050 libraries out there — you get MPU6050.KalmanAngleX/Y directly instead of doing sensor fusion yourself. It ships a full working example project (STM32F401CCU6, .ioc file and all) rather than just a snippet, so you can see the exact CubeMX I2C config that's expected. Single .c/.h pair with no external dependencies beyond the HAL makes it trivial to drop into an existing project.
Everything is blocking: MPU6050_Read_All uses polled HAL_I2C calls and the init pattern (while (MPU6050_Init(&hi2c1) == 1);) will spin forever with no timeout if the sensor is miswired or the bus locks up — there's no error path at all. No calibration/offset handling for accel or gyro bias, so out of the box the angles will have a static error that varies per unit. README is purely a CubeMX click-through guide (in English and Russian) with zero documentation of the MPU6050_t struct fields, filter tuning constants, or how to change the I2C address for AD0-high boards. No tests, no CI, and no commits since September 2023, so if STM32CubeIDE/HAL conventions shift under it, nobody's watching.