Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MPU9250 Reset reorganization (fixes I2C functionality) #7653

Merged
merged 2 commits into from Jul 20, 2017

Conversation

dennisss
Copy link
Contributor

During MPU9250 initialization, depending on passthrough modes, the main chip must be reset() before the magnetometer connection is initialized in order to setup the passthrough to the magnetometer.

Current sequence of events (during init):

...

  • reset()
    • "MPU6050" reset
    • AK8963 reset <- fails because not yet connected
  • Magnetometer init/connect

...

Fixed sequence:

...

  • reset_mpu()
    • "MPU6050" reset
  • magnetometer init
  • ak8963_reset()
    • AK8963 reset

...

The functionality of reset() is preserved, but for the initialization phase, the reset is split into a two phase reset.

Fixes #7624

Also adds a one liner fix specified in another issue report.

Copy link
Member

@davids5 davids5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dennisss

I am assuming the mpu9250 is connected by I2C.
I am sorry this was not tested, and your fix makes total sense. Thank you!

I would like to see the the SPI->I2C code moved to an interface and not have all this if pass through, but just invoke the functions on the interface.

@davids5
Copy link
Member

davids5 commented Jul 20, 2017

Jenkins test this please.

@davids5 davids5 merged commit 6081435 into PX4:master Jul 20, 2017
@davids5
Copy link
Member

davids5 commented Jul 20, 2017

@dennisss

What HW are you testing on? I have a few more changes to make and I would like to test the I2C interfaces as you were.

@dennisss
Copy link
Contributor Author

@davids5 the only platform I know of that does this is the Crazyflie 2 which is what I'm testing on.

Feel free to mention me in any PR's that may effect this so that I can test them.

And, yes it is connected via I2C, with the magnetometer as well as another sensor all setup to share the I2C bus provided by the MPU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flash PX4 onto Crazyflie 2 problem
3 participants