ICM-45686 failing to initialize gyro on RPI4b

Hi!
I’ve been configuring Ardurover (forked from Master Branch) with IMU (I2C) and barometer (I2C). I’ve been able to get everything working while using the AP_IntertialSensor_None driver. But when I revert those changes and try to use the Invensensev3 driver, Ardupilot crashes. In my hwdef file I configure the IMU with the line:
IMU Invensensev3 I2C:1:0x69 ROTATION_NONE

When I run Ardurover and look at the MAV messages I get the following:

AP: Calibrating barometer
Detected vehicle 1:1 on link 0
online system 1
INITIALISING> Mode INITIALISING
AP: Barometer 1 calibration complete
AP: Beginning INS calibration. Do not move vehicle
Init Gyrono link
link 1 down
no link

I’ve also tried the Generic_INS example file and gotten the same result. As far as I can tell the following is happening:

  • I2C can be read fine as demonstrated by being able to read the barometer
  • The WhoAmI register is read when the driver is initialized so Ardupilot can detect and read the I2C registers of the IMU
  • When Init Gyro is ran, the update() function is ran for the first time and fails
  • After update() fails, Ardurover seems to crash (hence the no link messages)

Troubleshooting Steps:

  • Used i2cdump to ensure that the sensor registers can be read and have data
  • Read samples from the IMU using a python script
  • Ensured that the driver changes the IMU’s registers before and after running (and the registers look like the correct settings)
  • Confirmed AP_InertialSensor_Invensensev3::accumulate_samples has n_samples > 0 → Implies that the FIFO counter register is being read correctly

My printout is currently a mess but here is a screenshot of what I’m getting. After a few loops it appears the accumulate_samples function stops running despite getting samples. The other print statements correspond to AP_InertialSensor::init_gyro() failing during the loop in lines 1726-1729

Has anyone ran into any issues similar to this? It seems like once I add the line in the hwdef the IMU should be plug and play.

Thanks!
Matt

1 Like

More information: The samples that are received (and shown above) either have no data or are bad. Looking at the headers its giving me (0x26, 0x28, 0x25) it appears that the accelerometer data is missing. I know that the IMU is set up correctly because I can manually read the FIFO buffer and see the correct headers:

To complete the record, here is what I heard from @rmackay9 in an email about this topic:

Connecting an IMU via I2C is not going to work well I’m afraid and we strongly recommend against it. The BeagleBoneBlue made this mistake and it was never a viable autopilot because of this. All of it’s processing power was consumed pulling data from the IMU and this meant almost no CPU was left over for running other processes. I’m sure others in the core AP dev team will give the same advice.

Thank you-

2 Likes

Hi @Christopher_Milner ,

I agree with Randy - the only exception in the BBlue case is to use on a Rover, all other scenarios is bad. All my work, the IMU and Baro I use the SPI bus and work really fine.

2 Likes