Linux IIO development
 help / color / mirror / Atom feed
* [BUG] mpu9150 magnetometer not working without powering accelerometer
@ 2025-03-28 21:56 Andreas Kemnade
  0 siblings, 0 replies; only message in thread
From: Andreas Kemnade @ 2025-03-28 21:56 UTC (permalink / raw)
  To: jean-baptiste.maneyrol, linux-iio, hns, tony

Hi,

on the Epson Moverio BT-200 containing two MPU 9150 I see a strange
behavior where I see only nearly fixed values until I enable the
accelerometer or gyroscope shortly. I am a bit puzzled what is really
going on here. It is the inv-mpu6050 driver.

Some tries:
root@bt200deb:~# cat /sys/bus/iio/devices/iio\:device1/in_magn_?_raw
27
27
27
root@bt200deb:~# cat /sys/bus/iio/devices/iio\:device1/in_magn_?_raw
26
26
26

x/y/z keep nearly the same and almost equal.

root@bt200deb:~# cat /sys/bus/iio/devices/iio\:device1/in_accel_?_raw
5950
-1782
14156

just one read from the accelerometer and things change for the
magnetometer.

root@bt200deb:~# cat /sys/bus/iio/devices/iio\:device1/in_magn_?_raw
54
54
-2
root@bt200deb:~# cat /sys/bus/iio/devices/iio\:device1/in_magn_?_raw
61
57
1

a full power cycle later and operating at register level:

root@bt200deb:~# cat /sys/bus/iio/devices/iio\:device1/in_magn_?_raw
26
28
28
root@bt200deb:~#

force powering on the chip
root@bt200deb:~# echo on >/sys/bus/i2c/devices/1-0068/power/control 
root@bt200deb:~# cat /sys/bus/iio/devices/iio\:device1/in_magn_?_raw
26
28
31
root@bt200deb:~# i2cget -f -y 1 0x68 0x6C    
0x3f
-> PWR_MGMT_2 -> everything in standby

enable accelerometer axes:
root@bt200deb:~# i2cset -f -y 1 0x68 0x6C 0x7

putting accelerometer axes into standby:
root@bt200deb:~# i2cset -f -y 1 0x68 0x6C 0x3f

enable runtime powermangement
root@bt200deb:~# echo auto >/sys/bus/i2c/devices/1-0068/power/control 
root@bt200deb:~# cat /sys/bus/iio/devices/iio\:device1/in_magn_?_raw
57
59
-1

magnetometer working.

Does anyone have some hints what is going on here and what could be the
real fix? Same behavior for the other mpu in the device
head->scratch(); ...

Of course the accelerometer could be enabled in probe() but that feels
more like a hackfix. 

Regards,
Andreas

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-03-28 22:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-28 21:56 [BUG] mpu9150 magnetometer not working without powering accelerometer Andreas Kemnade

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox