Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrupt MPU FIFO (MPU6050, MPU9150 etc.) on Raspberry PI (quaternion is outside of acceptable threshold) #150

Closed
greymfm opened this issue Jan 21, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@greymfm
Copy link
Member

greymfm commented Jan 21, 2024

When compiling and running Sunray firmware on a Raspberry PI, the MPU FIFO gets corrupted.

Steps to reproduce:

  1. Connect MPU (6050, 9150 etc.) to Raspberry PI.
    image
  2. Activate Raspberry CPU-based I2C driver ('sudo raspi-config'), MPU should be found with: sudo i2cdetect -y 1
    Screenshot from 2024-01-21 15-30-10
  3. Compile Sunray firmware on your PI:
    git clone https://github.com/Ardumower/Sunray
    cd Sunray/alfred/build
    cmake ..
    make
  4. sudo ./sunray

The MPU will be found but will not return any data. The reason is that the FIFO corruption check (in src/mpu/inv_mpu_dmp_motion_driver.c) fails:

if ((quat_mag_sq < QUAT_MAG_SQ_MIN) ||

Any ideas? :-)

To simply testing, I have made a 'IMU hello world project', just to test the MPU IMU:

  1. Unzip arduino_pi_imu_test.zip on your Rasperry PI

arduino_pi_imu_test.zip

  1. Adjust MPU type (in 'src/mpu/inv_mpu.c': #define MPU9150, MPU6050 etc.)
  2. Compile test code on your PI:
    cd arduino_pi_imu_test/build
    cmake ..
    make
  3. Run test code:
    sudo ./imu_test

The FIFO will be corrupted:

Screenshot from 2024-01-21 16-19-06

Playback of recorded I2C data can be activated (to test MPU-library without hardware) in ' src/mpu/arduino_mpu9250_i2c.cpp' (play=true) - If MPU library is compiled correctly, output should be like this:

Screenshot from 2024-01-23 11-01-30

@greymfm greymfm added the bug Something isn't working label Jan 21, 2024
@greymfm greymfm changed the title Corrupt MPU FIFO (MPU6050, MPU9150 etc.) on Raspberry Corrupt MPU FIFO (MPU6050, MPU9150 etc.) on Raspberry PI (quaternion is outside of acceptable threshold) Jan 21, 2024
@greymfm
Copy link
Member Author

greymfm commented Jan 22, 2024

Further tests (with different hardware, different OS etc.) show:

MPU 6050 working properly (without FIFO corruption message):

raspberry 3     Linux 4.14.79-v7+   armv7l    gcc 6.3.0            YES  
raspberry 4     Linux 4.19.97-v7l+  armv7l    gcc 8.3.0            YES
raspberry 3     Linux 6.1.21-v8+    aarch64   gcc 10.2.1           YES  ??
raspberry 4     Linux 6.1.21-v8+    aarch64   gcc 10.2.1           NO   
raspberry 5     Linux 6.1.0-rp7     aarch64   gcc 12.2.0           NO   
raspberry 4     Linux 6.1.0-rp7-v8  aarch64   gcc 12.2.0           NO   

greymfm added a commit that referenced this issue Jan 23, 2024
@greymfm
Copy link
Member Author

greymfm commented Jan 23, 2024

bugfixed in commit ( 6afe850 )

@greymfm greymfm closed this as completed Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant