Working with iMX6UL-EVK I2C Accelerometer/Magnetometer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Working with iMX6UL-EVK I2C Accelerometer/Magnetometer

Jump to solution
1,433 Views
arnaudne
Contributor II

Hi everyone,

I'm a bit of a noob in Embedded Linux development. I just got an iMX6UL Evaluation Kit and succeeded to build a working Yocto Project image (core-image-minimal based, with some development packages added, as evtest).

I would like to retrieve (from an user-space console for the moment) events from the FXLS8471 Accelerometer and MAG3110 Magnetometer I2C devices already populated and configured (I looked in the imx6ulevk device tree).

I then launched evtest where I could see that /dev/input/event2 and /dev/input/event3 refer respectively to the accelerometer and magnetometer, but they return no event when I read them.

I suppose that we should configure them to provide interrupts at a fixed rate, but I could not figure where I should be looking.

Could someone help me with this ?

Thanks a lot in advance.

Arnaud N. (France)

Labels (4)
0 Kudos
1 Solution
701 Views
igorpadykov
NXP Employee
NXP Employee

Hi Arnaud

for sensor test one can look at unit tests :

imx-test package  ../mxc_sensor_test/acctest.c

http://patches.openembedded.org/patch/103551/

https://support.bluetechnix.at/wiki/Linux_Software_User_Manual_%28i.MX6%29#Magnetometer_.28Freescale...

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
702 Views
igorpadykov
NXP Employee
NXP Employee

Hi Arnaud

for sensor test one can look at unit tests :

imx-test package  ../mxc_sensor_test/acctest.c

http://patches.openembedded.org/patch/103551/

https://support.bluetechnix.at/wiki/Linux_Software_User_Manual_%28i.MX6%29#Magnetometer_.28Freescale...

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
701 Views
arnaudne
Contributor II

Hi Igor,

Thanks to your answer, I managed to get the magnetometer working. Still seeking to enable the accelerometer input.

For the magnetometer, I used :

echo 1 > /sys/devices/virtual/input/input3/enable 

Then I could watch for events with :

evtest /dev/input/event3

But "/sys/devices/virtual/input/input2/enable" does not exist for Accelerometer... I will find another way to get it working !

Thanks again

Arnaud.

0 Kudos