PX4-Autopilot: ICM20948 in HERE 2 is not detected

Describe the bug The ICM20948 in the HERE 2 from ProfiCNC is not detected. WHOAMI value 0x00 is read.

To Reproduce Steps to reproduce the behavior:

  1. Connect HERE 2 to Pixhawk 2.1
  2. Flash PX4 master
  3. Boot flightcontroller
  4. See warning WARN [mpu9250] no device on bus 2

I’ve added a few lines of debug code and have figured out that the WHOAMI value is returned as 0x00

/*
 * If it's not an MPU it must be an ICM
 * Make sure register bank 0 is selected - whoami is only present on bank 0, and that is
 * not sure e.g. if the device has rebooted without repowering the sensor
 */
write(ICMREG_20948_BANK_SEL, &register_select, 1);
read(ICMREG_20948_WHOAMI, &whoami, 1);
warnx("whoami returned %u", (unsigned)whoami);
FMUv2 ver 0xE : Rev 0 V30
[boot] Fault Log info File No 4 Length 3177 flags:0x01 state:1
[boot] Fault Log is Armed
sercon: Registering CDC/ACM serial driver
sercon: Successfully registered the CDC/ACM serial driver
HW arch: PX4_FMU_V3
HW type: V30
HW version: 0x0009000E
HW revision: 0x00000000
FW git-hash: 8a313ffc26985f1c81ea494dbcf20760ff3be59a
FW version: 1.9.0 0 (17367040)
FW git-branch: master
OS: NuttX
OS version: Release 7.22.0 (118882559)
OS git-hash: c225d4a691ef4572839b19635a84f2d9bf07ea74
Build datetime: Jan 15 2019 08:34:24
Build uri: localhost
Toolchain: GNU GCC, 7.2.1 20170904 (release) [ARM/embedded-7-branch revision 255204]
PX4GUID: 0001000000003334353731375103003e0045
MCU: STM32F42x, rev. 3
[hardfault_log] Fault Log is Armed
INFO  [tune_control] Publishing standard tune 1
INFO  [dataman] Unknown restart, data manager file '/fs/microsd/dataman' size is 350216 bytes
INFO  [param] selected parameter default file /fs/mtd_params
rgbled on I2C bus 1 at 0x55 (bus: 100 KHz, max: 100 KHz)
WARN  [rgbled_ncp5623c] no RGB led on bus #2
nsh: rgbled_pwm: command not found
Board init: /etc/init.d/rc.board
WARN  [hmc5883] no device on bus 1 (type: 2)
WARN  [lis3mdl] no device on bus 2
INFO  [ist8310] no device on bus 1
INFO  [ist8310] no device on bus 5
INFO  [mpu9250] Bus probed: 2
WARN  [mpu9250] whoami returned 0
WARN  [mpu9250] no device on bus 2, init not OK
WARN  [hmc5883] no device on bus 2 (type: 1)
WARN  [mpu6000] no device on bus #3 (SPI1)
WARN  [mpu6000] no device on bus #5 (SPI4)
INFO  [mpu9250] Bus probed: 5
MPU9250 on SPI bus 4 at 4 (1000 KHz)
INFO  [mpu9250] accel cutoff set to 30.00 Hz
INFO  [mpu9250] gyro cutoff set to 80.00 Hz
L3GD20 on SPI bus 4 at 1 (11000 KHz)
LSM303D on SPI bus 4 at 2 (11000 KHz)
INFO  [mpu9250] Bus probed: 3
MPU9250 on SPI bus 1 at 4 (1000 KHz)
INFO  [mpu9250] accel cutoff set to 30.00 Hz
INFO  [mpu9250] gyro cutoff set to 80.00 Hz
MS5611_SPI on SPI bus 4 at 3 (20000 KHz)
MS5611_SPI on SPI bus 1 at 3 (20000 KHz)
WARN  [bst] no devices found
INFO  [mpu9250] Bus probed: 2
WARN  [mpu9250] whoami returned 0
WARN  [mpu9250] no device on bus 2, init not OK
px4flow [69:100]
INFO  [px4flow] scanning I2C buses for device..
INFO  [mavlink] mode: Config, data rate: 800000 B/s on /dev/ttyACM0 @ 57600B
Starting Main GPS on /dev/ttyS3
Starting MAVLink on /dev/ttyS1
INFO  [mavlink] mode: Normal, data rate: 1200 B/s on /dev/ttyS1 @ 57600B
No autostart ID found
INFO  [logger] logger started (mode=all)

NuttShell (NSH)
nsh>

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 31 (21 by maintainers)

Most upvoted comments

@flochir here is a working branch on top of current stable for your reference, https://github.com/bugobliterator/PX4Firmware/tree/pr-v1.8.2-ak09916 .

We have a working driver that Proficnc helped us write for HERE2, on a private repo. I’ll share but I don’t currently have time to do a PR for it. I’d be happy to provide to someone to add.

As for CAN support, there is engineering firmware available that has been provided to us that did work with PX4 though UAVCAN and the other cable supplied with HERE2. You’d need to contact proficnc to get it. We had to use an external CAN tool to update the firmware but then it worked with PX4. This was not extensively tested.

The Here 2 MCU acts as an I2C slave and emulates an AK09916 and a Toshiba LED.

So functionally yes, it shows up as a “naked” ak09916 on the I2C bus.