Here+ RTK GNSS ICM20948/MPU9250 Integration

Hi all,

I’m having an issue detecting and initializing all of the I2C sensors onboard the Proficnc Here+ RTK GNSS module on a Proficnc Pixhawk 2.1 Cube. Just to be clear, I am not having any issues with either the the M8P sensor or the safety switch, just the I2C channel.

PX4 is correctly initializing the rgbled application and controlling the onboard LEDs via I2C, so I know the PX4_I2C_BUS_EXPANSION is able to communicate with the Here+ module, but I have been unable to initialize any other sensors that are on the board according to Proficnc (HMC5983, MS5611, and the ICM20948/MPU9250).

I’m testing the Here+ on the v1.9.0-alpha commit which rolls in the ICM20948 integration into MPU9250 driver commit from early Dec 2018. According to this thread, @MQC reported that it was working well for them (unclear if they had success with just the GPS or the whole module including the additional sensors).

I’ve attempted to initialize the various onboard sensors via the following shell commands with no success:
mpu9250 -X -M -R 6 start
hmc5883 -C -T -X start
ms5611 -X start

All of these commands result in some form of the following error message: no device on bus 2. Although, I am able to run rgbled stop and rgbled start from the shell to turn off and on the LED control, respectively.

I’m wondering if anyone else has observed this behavior on a Here+ RTK module with the v1.9 releases? @dagar and @flochir I’m interesting in understanding if there is any other steps required for me to integrate, at least, the external mag from either the hmc5983 or ICM20948. I’m available to help debug, if any debugging/further development is required.

Also, @proficnc can you confirm that all of the sensors are on the same I2C or is there some intermediary?

Thanks!
Tony

Hi @tonysam1,

sorry, your post slipped by me, just noticed it.

You will have no luck using hmc5883. This chip is not produced anymore, which is why it has been replaced by ICM20948. The design contains pads for multiple different magnetometer as options, but only one is actually used. I only know of Here/Here+ devices with ICM20948 since the cancellation of hmc5883.

mpu9250 -X -M -R 6 start would be correct. Can you also check that you’re not running into #11189?

I briefly tested a Here+ recently and the integration ICM20948 was working. I will take a closer look and update.

Hi @flochir, sorry for the delay.

I chatted with Philip Rowse here and resoved the issue with a patch for the time being.

Here’s what I found and how I patched the issue:

We are using the Here+ V2 RTK module. The I2C is directly connected to a STM32 on the Here+ V2 RTK module. The firmware onboard that STM32 only emulates the TCA62724 (LEDs) and the AK09916 (mag onboard the ICM20948). Therefore, when you initialize the currently implemented ICM20948 driver in mag only mode, it probes for the ICM20948 which does not exist because the Here+ V2 RTK only emulates the AK09916.

For the time being, we simply patched the ICM20948 driver by ignoring the return from the ICM probe when in magnetometer only. For example, from drivers/imu/icm20948.cpp:257

int ret = probe();

/* added && !_magnetometer_only to skip the ICM20948 probe return when in mag only mode */
if (ret != OK && !_magnetometer_only) {
	PX4_DEBUG("ICM20948 probe failed");
	return ret;
}

Another thing to note is that the standalone AK09916 magnetometer has a different rotation from the ICM20948 gryo/accel. On the die it is rotated yaw 270, therefore in rc.sensors, we need to initialize the patched driver like this:

# ICM20948 as external magnetometer on I2C (e.g. Here GPS)
icm20948 -X -M -R 14 start

FYI, this is only a patch so we could move forward. I started a standalone AK09916 magnetometer driver but never finished it because of changing priorities. With that said, I’d love to help out in anyway getting a standalone AK09916 driver merged into the codebase.

I hope this helps!
Tony

Hi @tonysam1 ,

as you’re using a Here+ V2 (thought of a V1 based on your first post), you might be interested in following #11230. You write here that you have the AK09916 running? I was working on a standalone driver at first, too, maybe this is useful: #9345. Do you have a repository up with your code somewhere?

I’d like to overhaul the mpu9250 at some point and make the magnetometer driver capable of working on itself, but can’t give it a lot of effort right now.

Btw. I tested a Here+ GNSS V1 on a Pixhawk 2.1 Cube, and ICM20948 as well as ms5611 were working.