Firefly Open Source Community

Title: Firefly-RK3399 MPU6050 [Print This Page]

Author: james    Time: 5/29/2019 16:07
Title: Firefly-RK3399 MPU6050
Last edited by james In 5/29/2019 16:17 Editor

Hi,

MPU6050 sensor to Firefly-RK3399 board on J21 connector
7 pin - VCC3V3_SYS (MPU6050-VDD),
8 pin - GND (MPU6050-GND),
25 pins - I2C4_SDA (MPU6050_SDA),
26 pins - I2C4_SCL (MPU6050_SCL),
29 pin - SPI1_RXD (MPU6050-INT) is connected.

Attach photos and files.
1. Firefly-RK3399 + MPU6050.jpg
2. SensorFind.apk
SensorFind.apk (1.48 MB, Down times: 7)







And I installed the application (SensorFind.apk) to find the Android sensor, but it did not recognize the sensor.
I want to rotate the HDMI output screen every time the MPU6050 sensor moves.

Waiting for your help.

Author: penguin    Time: 5/30/2019 09:58
You need to add MPU6050 kernel driver and Android HAL support to get it working.
Author: james    Time: 5/30/2019 13:27
It is already applied to rk3399-firefly-port.dtsi file, and Android HAL support is already applied.

rk3399-firefly-port.dtsi
....
....
&i2c4 {
    gsl3680: gsl3680@41 {
              status = "disabled";
              compatible = "gslX680";
              reg = <0x41>;
              screen_max_x = <1536>;
              screen_max_y = <2048>;
              touch-gpio = <&gpio1 20 IRQ_TYPE_LEVEL_LOW>;
              reset-gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
      };
        mpu6050:mpu@68{
            status = "okay";
            compatible = "invensense,mpu6050";
            reg = <0x68>;
            mpu-int_config = <0x10>;
            mpu-level_shifter = <0>;
            mpu-orientation = <0 1 0 1 0 0 0 0 1>;
            orientation-x= <1>;
            orientation-y= <1>;
            orientation-z= <1>;
            irq-gpio = <&gpio1 7 IRQ_TYPE_LEVEL_LOW>; /*gpio1 A7*/  
            mpu-debug = <1>;
        };
};

Where do I find out where Android HAL support is applied?
Author: james    Time: 5/30/2019 13:52
penguin Posted at 5/30/2019 09:58
You need to add MPU6050 kernel driver and Android HAL support to get it working.

Hi penguin,

Thank you for the reply.

It is already applied to rk3399-firefly-port.dtsi file, and Android HAL support is already applied.
Where do I find out where Android HAL support is applied?

Author: penguin    Time: 6/5/2019 09:06
Hi james,

Please check to make sure that the sensor is probed and initialized correctly by inspecting the kernel log first.
Author: james    Time: 6/5/2019 17:48
Last edited by james In 6/5/2019 17:52 Editor
penguin Posted at 6/5/2019 09:06
Hi james,

Please check to make sure that the sensor is probed and initialized correctly by inspec ...

Hi penguin,

kernel build error

Error: arch/arm64/boot/dts/rockchip/rk3399-firefly-port.dtsi:200.11-12 syntax error
FATAL ERROR: Unable to parse input tree

rk3399-firefly-port.dtsi
....
....
&i2c4 {
          mpu6500_acc@68 {
                status = "okay";
                compatible = "mpu6500_acc";
                reg = <0x68>;
                type = <SENSOR_TYPE_ACCEL>;   //  There was an error in this part. //
                irq-gpio = <&gpio1 7 IRQ_TYPE_EDGE_RISING>;               
                mpu-int_config = <0x10>;
                mpu-level_shifter = <0>;
                mpu-orientation = <0 1 0 1 0 0 0 0 1>;
                orientation-x= <1>;
                orientation-y= <0>;
                orientation-z= <0>;
                mpu-debug = <1>;
        };
};

I need your help.
Thank you.






Welcome Firefly Open Source Community (https://bbs.t-firefly.com/) Powered by Discuz! X3.1