Closed
Description
I was using Arduino_Core_STM32 release 1.5.0 with MPU9250 library by hideakitai. It was working fine until I upgraded to the latest release of 1.8.0. With 1.8.0, i2c bus was not able to locate the AK8963 device.
I've tested Arduino_Core_STM32 release 1.5.0, 1.6.0, 1.6.1, 1.7.0 & 1.8.0. Only 1.8.0 has problem with the MPU9250 library. All other releases worked fine.
Hardware Configuration:
Blue pill (stm32f103c8) with i2c (PB11, PB10) connected to a MPU9250 link
Sample sketch to reproduce the problem:
#include "MPU9250.h"
MPU9250 mpu;
void setup()
{
Serial.begin(115200);
Wire.begin();
delay(2000);
mpu.setup();
}
void loop()
{
static uint32_t prev_ms = millis();
if ((millis() - prev_ms) > 16)
{
mpu.update();
Serial.print("roll, pitch, yaw: ");
Serial.print(mpu.getRoll());
Serial.print("\t");
Serial.print(mpu.getPitch());
Serial.print("\t");
Serial.println(mpu.getYaw());
prev_ms = millis();
}
}
Output with AK9963 not found (with rel 1.8.0):
MPU9250 WHO AM I = 71
MPU9250 is online...
AK8963 WHO AM I = 0
Could not connect to AK8963: 0x0
roll, pitch, yaw: 0.00.0.00.-3.00
roll, pitch, yaw: 0.00.0.00.-3.00
Expected output when working (with release 1.5.0 to 1.7.0):
MPU9250 WHO AM I = 71
MPU9250 is online...
AK8963 WHO AM I = 48
Calibration values:
X-Axis sensitivity adjustment value 1.20
Y-Axis sensitivity adjustment value 1.21
Z-Axis sensitivity adjustment value 1.16
X-Axis sensitivity offset value 0.00
Y-Axis sensitivity offset value 0.00
Z-Axis sensitivity offset value 0.00
roll, pitch, yaw: 170.50.-67.37.-155.35
roll, pitch, yaw: 171.00.-68.81.-155.60