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

Fix mpu9250 hardfaults #11190

Merged
merged 3 commits into from
Jan 14, 2019
Merged

Fix mpu9250 hardfaults #11190

merged 3 commits into from
Jan 14, 2019

Conversation

dakejahl
Copy link
Contributor

@dakejahl dakejahl commented Jan 10, 2019

Problem
The mpu9250 driver will cause a system hard fault if the driver is attempted to be started on an already started bus. This is due to the introduction of extraneous bus options in #10116. Specifically the bus options for MPU_DEVICE_PATH_MPU6500_* . These options used the name exact CS, path, etc as the non 6500 option, however the dev pointer was still NULL, so it tried to start the bus.

To reproduce
This problem behavior can easily be observed by issuing an mpu9250 start via the NSH after the system has booted.

Solution
I've removed the 6500 bus options. These are not necessary, as the device type will be discovered via the WHOAMI register (besides, the only difference between the 6500 and 9250 is the mag). I've also removed the extra bus options for the ICM20948 as they do not appear to be used.

@flochir Could you please test this to make sure everything is still good on your end?

…lts if attempting to start an already running driver. Changed NULL to nullptr. Removed bus options that were unused
@dakejahl
Copy link
Contributor Author

@dagar My style check is all jacked up. It forces
delete(bus.dev);
locally, but jenkins wants
delete (bus.dev);

Also make format doesn't work, still getting

Error: you're using Artistic Style Version 2.05.1
but should be using Artistic Style Version 2.06, Artistic Style Version 3.0, Artistic Style Version 3.0.1, or Artistic Style Version 3.1 instead

@LorenzMeier
Copy link
Member

You will need to update astyle in your local install.

@dakejahl
Copy link
Contributor Author

homer

@dakejahl
Copy link
Contributor Author

ROS tests are failing, not sure what's going on here.

@dagar
Copy link
Member

dagar commented Jan 11, 2019

This looks fine, but let's do a quick check on the various setups.

  • pixracer (single mpu9250)
  • TealOne (mpu9250 + mpu6500)
  • external Here GPS (icm20948)
  • crazyflie mpu9250 i2c?

@flochir
Copy link
Contributor

flochir commented Jan 13, 2019

@dagar No hardfault on Pixhawk 2.1 Cube, and no problems with ICM20948 on Here GNSS.

@dagar dagar merged commit 29f034c into master Jan 14, 2019
@dagar dagar deleted the pr-mpu9250_fix_hardfault branch January 14, 2019 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants