Commit Graph

41 Commits

Author SHA1 Message Date
David Sidrane f722614ec0 mpu9250:Stop per counter on failed read 2017-07-08 15:37:46 +02:00
David Sidrane fbf6532c25 mpu9250:reset the mag on the reset operation
This commit fixed a bug were the mag was orphened on a reset.
   That resulted in MAG timeouts on reset or test operations and
   left the mag in a broken state.
2017-07-08 15:37:46 +02:00
David Sidrane aec109ac2c mpu9250:mag restructure to have proper retires for setup
We want to setup the mag interface with retries and report
  failurs.

  Move retry logic to contol point, instead of hiding re-reading
  the ID in ak8963_check_id.

  Allow it to fail once to overcome a read of 0 on firt read.
  after 2 failure report error to console and reset the
  mpu9250's I2C master (SPI to I2C bridge)

  The same retry logic is used on the ak8963_read_adjustments
  with a reset of the I2C master module after 5 fails. If it
  fails fter 10 retires. Disabel the mad and report the failure
  on the console, stating it is disabled.
2017-07-08 15:37:46 +02:00
David Sidrane 270dd5282a mpu9250:Add modify checked register api
Provide an API for the mag to use read-modify-write
2017-07-08 15:37:46 +02:00
David Sidrane ef67b75057 mpu9250:Added comment on BYPASSING the internal i2c master bridge 2017-07-08 15:37:46 +02:00
David Sidrane c3addd931c mpu9250:Issue error on console when a device fails to take initialization
On initialization, if after 3 retries to re-init the mpu9250 from
   the checked registers values, it fails. Ensure thath the fact the
   driver is exitting is logged to console.
2017-07-08 15:37:46 +02:00
David Sidrane 3272cc62d4 mpu9250: Do a reasonable post chip init validations, reporting errors
Check that the mpu9250's configured registers match the settings
   written to them. Attempt to fix any that do not up to 3 times.
   printing erros to the console on mismatches and returning
   faliure if after 3 attempts the any of the values are
   still wrong.
2017-07-08 15:37:46 +02:00
David Sidrane 7e293ab1d3 mpu9250:Fix errant comment 2017-07-08 15:37:46 +02:00
David Sidrane 5a53d92f22 mpu9250:Remove foklore delays
Remove delays on each register write in the
   reset function. Leaving only the delay
   following chip reset prior to configurations.
2017-07-08 15:37:46 +02:00
David Sidrane b4d23a3f2c mpu9250:Rmove magic number, add ACCEL_RANGE_G 2017-07-08 15:37:46 +02:00
David Sidrane c3c5be3881 mpu9250 Fixed 'test' function causes register checking to find a false faults
Diisabled interrupts in reset to make command to reset atomic.

      Added hold off of testing for register faults from the duration
      of the test.
2017-04-14 09:58:14 +02:00
Lucas De Marchi 3200b032c0 mpu9250: add support to MPU6500
MPU9250 is mostly an MPU6500 with a mag (AK8963) in the same package.
Support driving MPU6500 with the MPU9250 driver. The id of the driver
isn't set differently since this way it allows to force a recalibration.

Ideally MPU9250 driver could even not exist and the support for these
sensors be merged back in the MPU6000 that's more complete. This is an
intermediate step in that direction.
2017-04-06 12:18:30 +02:00
Paul Riseborough 253683af5f drivers: Don't require driver level gyro offsets to be non-zero 2017-02-01 08:40:23 +01:00
Paul Riseborough c00c638b77 Remove IMU calibration parameter checks 2017-02-01 08:40:23 +01:00
Lorenz Meier e7a0089340 9250: Fill device ID for mag correctly 2017-01-29 16:24:47 +01:00
Lorenz Meier 0ee68071fc 9250: Add missing bus identifier 2017-01-29 16:24:47 +01:00
Lorenz Meier 62f95931ed MPU9250: Fix device ID 2017-01-19 19:24:52 +01:00
Paul Riseborough e84a189380 drivers: use driver class instance as surrogate sensor ID for gyro and accelerometer 2017-01-19 19:24:52 +01:00
Paul Riseborough 7c9e9f31e1 drivers/mpu9250: Populate device ID in sensor topics 2017-01-19 19:24:52 +01:00
Michael Schaeuble bdb76d013e Fix incorrect MPU9250 device ID
We propagate the bus parameters from the bus interface to the sensor
devices. Thus, the device ID of the sensor driver is set to the correct
bus id and address. Otherwise it would be zero, which is an issue if several MPU9250s
are running at the same time.
2016-12-09 18:59:42 +01:00
Dennis Shtatnov e6b98b2ab8 Tweak configs for CF2
Fix build error

Capitalization mistake for headers

Non-Mac compiler issue

Baudrate for crazyflie nrf and fix code style

Save space

Cleanup mpu9250 driver
2016-09-04 19:12:08 +02:00
Dennis Shtatnov 5100785f51 MPU9250 I2C mode
Fixes for other boards

Functioning sensors
2016-09-04 19:12:08 +02:00
Tim Dyer b65ff53b00 Initial build for Crazyflie 2.0
Working crazyflie firmware build

* Console on USART3
* Could not disable building PX4IO firmware, currently commented out

Don't build PX4IO firmware if the board doesn't ask for it

Added crazyflie motor driver

Fixed wrong register

CLK_SEL is in PWR_MGMT_1

Initial I2C/SPI MPU9250 device

* Tested with I2C
* Need to add error checking
* Intermittent crash on stop call

Working ak8963 mag driver

Functional lps25h driver. Work in progress.

Works well enough to probe and allow sensors task to start.

Added serial port test module

HACK! Get sensors module working

Set crazyflie PWM range

Extend baudrate for Crazyflie's NRF radio

Added dummy tone alarm to allow for init

Added autostart script for Crazyflie
2016-09-04 19:12:08 +02:00
Julian Oes dd70b3752a mpu9250: set accel DLPF to 41 Hz (#5177)
Previously, the accel DLPF was not set, so it's not clear what the
settings are or should be.
2016-07-31 08:04:01 -07:00
Lorenz Meier 7398164fcc Updated PX4 use / API of low level GPIO and other hardware-centric system facilities 2016-05-28 14:56:17 +02:00
Daniel Agar 69c1ce1714 WIP logger serialization 2016-05-14 11:27:07 +02:00
Daniel Agar eb29b33620 use gcc attributes to align and pack 2016-05-14 11:27:07 +02:00
Lorenz Meier 5a65f41482 MPU9K: Use shorter perf names 2016-03-28 13:03:56 +02:00
Julian Oes e0c41632a6 drivers: some fixes for the calibration refactor 2016-03-24 13:08:30 +01:00
Julian Oes b9cc0b74e2 drivers: re-use calibration topic
E.g. instead of defining a gyro_scale struct in drv_gyro.h, use the
gyro_calibration message.
2016-03-24 13:08:30 +01:00
Robert Dickenson 481e28aae1 Minor format/whitespace changes courtesy of AStyle 2016-03-08 09:29:17 +01:00
Robert Dickenson 95e51ed8c6 Cleanup mpu9250 driver in preparation for PR 2016-03-08 09:29:17 +01:00
Robert Dickenson 4ef9148517 Preparing MPU9250 driver for PR
Corrected magnetometer gain and alignment, added support for sensitivity adjustment values, cleaned up debugging messages and removed dead code.
2016-03-08 09:29:17 +01:00
Robert Dickenson 5903891213 Significant work on mpu9250 driver to get magnetometer updates happening reliably. Improved 'mag' utility to aid driver development and testing. 2016-03-08 09:29:17 +01:00
Robert Dickenson 0050057392 Add internal AK8963 magnetometer support to the MPU9250 device driver 2016-03-08 09:29:17 +01:00
Lorenz Meier 260b77dd78 MPU9250: Make check return values more discriminative 2016-01-31 14:53:40 +01:00
Lorenz Meier f4f143927f MPU9K: Remove unused perf counter 2015-11-29 13:41:17 +01:00
David Sidrane e41c3cf876 Missing Close es and poll rate reset 2015-11-21 01:09:58 -10:00
David Sidrane 6bab225fed Added the integration like on mpu6000 2015-11-20 04:17:24 -10:00
Lorenz Meier 9a33e6e2aa Fixed MPU9250 formatting 2015-10-19 10:08:17 +02:00
Andrew Tridgell 39e0a487bb mpu9250: first cut at a MPU9250 driver 2015-08-17 09:16:47 +02:00