Skip to main content
Visitor II
March 25, 2025
Question

MPU6050 driver on the STM32F746-DISCO board

  • March 25, 2025
  • 1 reply
  • 571 views

Hello, My name is Barbra, and I am working on a project using the STM32F746-DISCO board, and I need to help to debug an issue. I have written an I2C driver for the MPU6050 board, and I can't fetch any data from it. the accelerometer, gyroscope and temperature registers all seem to be at 0 always when i run the script in debug mode. I can see that the sensor gets identified through its WHO_AM_I register and gets the right readings, 0x68, but I can't get the data from the chip. i am using the STM32 HAL.

i would appreciate any help presented. Thank you.

Attatched are the files to my script.


1 reply

Andrew Neil
Super User
March 25, 2025

@Barbra_Gitonga wrote:

I can see that the sensor gets identified through its WHO_AM_I register and gets the right readings, 0x68,


Suggests that physical connections are OK, but please attach your schematic anyhow - to be sure.

 


@Barbra_Gitonga wrote:

I can't fetch any data from it. the accelerometer, gyroscope and temperature registers all seem to be at 0 always


Have you used an oscilloscope and/or analyser on the I2C lines to see what's actually happening in the hardware?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.