-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Fix mpu9250 hardfaults #11190
Conversation
…lts if attempting to start an already running driver. Changed NULL to nullptr. Removed bus options that were unused
@dagar My style check is all jacked up. It forces Also
|
You will need to update astyle in your local install. |
ROS tests are failing, not sure what's going on here. |
This looks fine, but let's do a quick check on the various setups.
|
2ae344f
to
9949f48
Compare
@dagar No hardfault on Pixhawk 2.1 Cube, and no problems with ICM20948 on Here GNSS. |
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 thedev
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?