Firefly Open Source Community

   Login   |   Register   |
New_Topic
Print Previous Topic Next Topic

Interface external MPU6050 gyro/accelerometer to I2C4 bus

75

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
75

Interface external MPU6050 gyro/accelerometer to I2C4 bus

Posted at 11/26/2017 22:50:23      View:2912 | Replies:2        Print      Only Author   [Copy Link] 1#
Last edited by dariuskrail In 11/26/2017 22:50 Editor

Hello all,

I am connecting a MPU6050 gyro/accelerometer breakout board to the Firefly-RK3399 board through the I2C4 SDA and SCL pins. I downloaded the AOSP source from Gitlab at https://gitlab.com/TeeFirefly/FireNow-Nougat.git. We are using Android 7.1.1 for our project. I modified the rk3399-firelfy.dts file to add support for the MPU6050 by adding the codes below.

&i2c4 {
        status = "okay";
        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>;
                /* Original is gpio1 4 (GPIO1 A4). Change to gpio 1 9 (GPIO 1 B1). */
                irq-gpio = <&gpio1 9 IRQ_TYPE_LEVEL_LOW>;
                mpu-debug = <1>;
        };
};


Next I recompiled the kernel, with the command "sudo ./FFTools/make.sh -k -j8" and "sudo ./FFTools/mkupdate/mkupdate.sh". A new rk3399-firelfy.dtb file is generated and the kernel is successfully built. Then I flashed the only the kernel, resource and boot image files (.img) to the board with the commands.

"sudo upgrade_tool di -b boot.img"
"sudo upgrade_tool di -k kernel.img"
"sudo upgrade_tool di resource resource.img"


After that we reset the board and Android boots up successfully. The MPU6050 is also successfully probed by the kernel as shown in the kernel logs with "dmesg" below.

[18:03:05][    0.773142] inv-mpu-iio 4-0068: int_config=0,level_shifter=0,client.addr=68,client.irq=6b
[18:03:05][    0.773874] inv-mpu-iio 4-0068: 0
[18:03:05][    0.773890] inv-mpu-iio 4-0068: -1
[18:03:05][    0.773899] inv-mpu-iio 4-0068: 0
[18:03:05][    0.773908] inv-mpu-iio 4-0068: -1
[18:03:05][    0.773916] inv-mpu-iio 4-0068: 0
[18:03:05][    0.773925] inv-mpu-iio 4-0068: 0
[18:03:05][    0.773934] inv-mpu-iio 4-0068: 0
[18:03:05][    0.773942] inv-mpu-iio 4-0068: 0
[18:03:05][    0.773950] inv-mpu-iio 4-0068: -1
[18:03:05][    0.773959] inv-mpu-iio 4-0068:
[18:03:05][    0.773968] inv_mpu_iio: secondary_i2c_addr=0
[18:03:05][    1.096795] inv-mpu-iio 4-0068: mpu6500 is ready to go!

[18:03:05][    1.096898] inv_mpu_iio: inv_mpu_init:744

Although the MPU6050 chip is detected in the kernel, the apps in Android is still unable to work with the MPU6050. There is no movement in the apps even when I move the MPU6050 breakout board around. Anything else do I need to do to setup the MPU6050 on I2C4 and GPIO1 B1 so that my Android apps can use the gyroscope and accelerometer?

Thank you!




Reply

Use props Report

75

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
75
Posted at 12/2/2017 02:31:32        Only Author  2#
Bump. Any idea what other settings I need to check or change on the Linux kernel or Android source codes to enable the MPU6050?
Reply

Use props Report

76

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
76
Posted at 12/21/2017 15:28:05        Only Author  3#
One a lot of different methods for you to get cool today is certainly by subscribing to fashion periodicals and other suggestions as good. A massive amount fashion magazines come for few dollars. If you love is a superb getting fashion periodicals you might need to flip thru one prior to you subscribe.        fashionstellar
Fashion has got certainly come quite some distance from the top end hats together with petticoats era within the past. Clothes today are a great schooling would include biology aesthetics together with function. One might are convinced a result of progress that many of us have maid in the neighborhood of gear        fashionnational
The sketches give some sort of insight into the fashion fraternity and then to the well-known audience over the concept behind a precise fashion structure. It may be a way for communicating any theme into the people linked to the apparel community.        smallbusinessfashion
The nation of way design, by just its wide glamour together with grace, is without question exciting together with intriguing. When you talk for fashion structure, it implies a style of art the fact that incorporates any nuances to build clothes together with accessories.        skillfashion
Way market is certainly continuously improving. The traits change seasonably. Way is for no reason stagnant, it is actually never sturdy. Therefore those who who wish to make a job in way industry has to be adaptable that will such types of changes.        practicefashion
Way on TV FOR PC, we will all see it zero cost and you can easliy see it all on some of our TV's, but now you can easliy also see it broadcast on line as good and in many cases its zero cost. So, so why are agencies providing zero cost fashion TV FOR PC? Quite only        getafashion
Fashion can be dismissed as the frivolous frippery, a good nonsense, whatever really is not going to matter in anyway. Those with no interest during the topic is sometimes more compared with scathing about that. But individuals are omitted something.        chaseshopping
Your way statement will say multiple issues about an individual's image and like you would dress. On earth do you impress, turn-off, or simply invite agreeable compliments? There are plenty of ways carryout a fashion fact as one can find fashion varieties. What does your look say?        answerfashion
For creating a superior career during this field, you need to choose one of the best job that assists you attain a good position. It will be important because way industry may be a diverse field professionals who log in only issue if that you're extraordinarily great from a particular space.        xchangefashion
Making it as the Fashion Fashionable today is labor. This report will help you during the right focus and aid you focus over the key areas you might want to address if you'd like to succeed in the business.        wizardsfashion
If that you're a fans of way then you can expect to know to be always shifting. It is certainly hard to maintain to date using what is incredibly hot and that which is not because there does exist so substantially that way covers.        warriorfashion
Relating to fashion, many people are unaware of where get started on. Following personal blogs, reading catalogues, and visiting various fashion retail outlets may guide fashion encouragement. Here happen to be some tips to be able to learn easy methods to create way inspired wardrobe.        specialistsfashion
Fashion looks at any form of dressing that could be popular in a particular point in time or from a particular put. Fashion may be a style or simply a practice notably in gear, footwear, products, in makeup or in body system art (orite. g pirecing, tattoo).        professionalsfashion
Way, in a native feel, is a good term to your most funky and popular variety of clothing, foot wear or accessories meant for personal grooming. It's the latest trend during the attire of each individual by using a certain layout in patterns, as good.        prepfashion
Fashion design stands out as the talent for applying structure to body system shapes the best way to come up with fashionable gear. For you to succeed in the society of way and design you ought to be ready to do sketches and drawings.        factsfashion
A massive amount couples look like they could of used a little professional information to method their vision wedding. Some couples look like they need numerous help! Knowing which types of wedding professional you ought to hire can get confusing, since all can name himself or simply herself by just whatever brand they like.        workwedding
It's a good preconceived belief that planning marriage is overpriced. The major expense will be the venue that can cost a predetermined fixed on a daily basis rate. Could very well be surprised to be controlled by that haggling with immediately the wedding venue        universitywedding
In order to make an good income from being a wedding photographer, you really don't just need to be thought of a accomplished photographer or manifest as a master to your camera. You need to find tips on how to demonstrate the fact that to some people.        supportwedding
One extremely important actions for big event couples that happen to be interested during preserving any memories within their wedding day could be to hire a competent wedding photographer. But it is actually quite typical to your lovely couple to prioritize about all other things except that will be your wedding photographer.        studentwedding
Everything other than them comes earliest, the dress up and tux, any bouquet, any reception. It is actually at your bottom within the list that will be during charged within the wedding picture taking.        momswedding
Utilizing being married photographer is really important for anyone that is excited about preserving memories within their special daytime. While rather for the lovely couple to are worried about various components of their wedding including flowers        knowwedding
Some consumers simply think that they will just purchase a wedding photographer and now have their shots taken. Often, the lovely couple may decide to use a family member or simply a close friend become the official big event photographer thus to their special daytime.        howwedding
Such things as professionalism, experience and being able to provide take pictures services in several formats are some primary advantages of obtaining a competent wedding photographer.        answerwedding
Do you no doubt know how countless universal laws one can find? Or that they work? They're just an traditional and straightforward guide that will living spiritually, as you will see that if you study...        lawshowcase
What is certainly law for attraction? This question has been in air the past decade for the reason that theory for this law has become public following a release within the book "The Secret". Herein the laws of attraction has long been mentioned during details        lawextreme
Everything regarding this universe is alot more intelligent compared with we grant credit meant for; it is a real dazzling coherence the fact that run some of our lives. Our company is here that will mould any energies towards matter together with create together with share Completely happy Living.        lawcountry
The universe is made up of distinct rules and standards that control our way of living. Both results and catastrophe are in your own control. Despite your own condition, you can make an improvement in everyone life and attracting more effective things using these rules...        lawbucket
California is known to have most of the strictest handgun control laws in the nation with something like 950 firearm laws currently basically. Supporters for stricter handgun laws argue these laws are necessary to hold back crime        lawadventure
       
A good number of finance careers need you to be decent with details and know about basic internet business statistics. Let's review some belonging to the lucrative finance education possible choices.        enterprise finance
Equity loan means the dog owner, own dollars and loan. Usually small-scale scale business which includes partnerships and even sole proprietorships can be operated as a result of their entrepreneur trough their own individual finance. Joint supply companies operate on such basis as equity futures        anywhere finance
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