-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
Added 2 IMU I2C drivers, SPI mode and bus speed option, fixed 1 I2C read bug, etc. [rebased] #14546
Conversation
@bkueng Thanks a lot for helping with the merge! When starting with correct configuration parameters, barometer and IMU sensors worked with minor changes described below, please get these changes into imu_drivers_i2c_interface branch. Two changes to get code compiled natively on my board:
mpu9250 and icm20948 need alternate between 2 SPI frequencies (high and low frequency) on the fly, the following changes are needed to take the frequency specified in command options as the high frequency:
Two observations for future consideration: a) When redundant sensors are used, I cannot clearly get a sense which sensor behaved better when seeing/hearing error messages like "Gyro #0 fail". It would be better to change it to something like "Gyro #0 (mpu9250) fail" b) When incorrect internal/external SPI/I2C options were given, neither error messages and nor successful messages were printed out. |
I tested another sensor board and found a problem with I2C device address. The problem did not exist in previous code which does not use BusCLIArguments, etc. yet. It seems that addresses of I2C FXAS21002C and FXOS8701CQ drivers were hard coded (0x20, 0x1E below):
Previously the addresses were configured by the following macros:
I have 2 sensor boards with one board uses addresses 0x20, 0x1E and another uses 0x21, 0x1F for FXAS21002C and FXOS8701CQ respectively. Handling this kind of configuration with BusCLIArguments, etc. is an improvement over previous usage of macros as it's allowed to use command option to conveniently configure addresses of I2C drivers. |
f950307
to
16d58ad
Compare
@UAV-Pilot I applied your changes, including configurable I2C address for the 2 drivers (didn't think anyone would want to use the non-default address). |
@bkueng I got the latest from imu_drivers_i2c_interface branch, and it worked as expected! Your help is highly appreciated! |
Good! |
Tested on NXP FMUK66 V3Modes Tested
Procedure Notes Log |
Any chance to get reviewed and merged soon? It's almost 2 months now since the original pull request #14168 was submitted. |
@dagar good to go? Do you want to branch out for the release first? |
Is there any special reason preventing this pull request from being merged? |
@UAV-Pilot I apologize, we've been going back and forth trying to get things ready for a release, but a number of issues keep pushing it back. It looks like we're going to have a bit more time still, so let's get this in. |
Rebased on current master. |
16d58ad
to
06c1375
Compare
You're welcome. It should not have taken that long in the first place (was because of the release). |
Rebased version of #14168. @UAV-Pilot can you test it? And let me know if I dropped something, there were many conflicts.
Tested on nxp/fmuk66.