Firefly Open Source Community

   Login   |   Register   |
New_Topic
Print Previous Topic Next Topic

[Android] Firefly-RK3399 MPU6050

144

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
144

【Android】 Firefly-RK3399 MPU6050

Posted at 5/29/2019 16:07:02      View:5015 | Replies:5        Print      Only Author   [Copy Link] 1#
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: 8)







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.
Reply

Use props Report

1396

Credits

0

Prestige

0

Contribution

vip

Rank: 6Rank: 6

Credits
1396
Posted at 5/30/2019 09:58:40        Only Author  2#
You need to add MPU6050 kernel driver and Android HAL support to get it working.
Reply

Use props Report

144

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
144
Posted at 5/30/2019 13:27:39        Only Author  3#
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?
Reply

Use props Report

144

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
144
Posted at 5/30/2019 13:52:11        Only Author  4#
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?
Reply

Use props Report

1396

Credits

0

Prestige

0

Contribution

vip

Rank: 6Rank: 6

Credits
1396
Posted at 6/5/2019 09:06:54        Only Author  5#
Hi james,

Please check to make sure that the sensor is probed and initialized correctly by inspecting the kernel log first.
Reply

Use props Report

144

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
144
Posted at 6/5/2019 17:48:34        Only Author  6#
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.

Reply

Use props Report

You need to log in before you can reply Login | Register

This forum Credits Rules

Quick Reply Back to top Back to list