Hi NXP,
I have a problem in connect magnetic sensor GY-271 with iMX6UL-EVK.
Firstly, I access menuconfig and turn driver of this sensor on.
Device Drivers > Industrial I/O support > Magnetometer Sensors > Honeywell HMC5843/5883/5883L 3-Axis Magnetometer (I2C)
Secondly, I customize device tree imx6ul-14x14-evk.dts in arch/arm/boot/dts by adding these line at the end of file:
&i2c4 {
status = "okay";
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c2>;
hmc5883l@1e {
compatible = "honeywell,hmc5883l";
reg = <0x1e>;
position = <0>;
};
};
Thirdly, I connect 4 pins of sensor to iMX6Ul kit with power supply is 3,3V and pin 9(SDA)-10(SCL) of J1704 header. <This step is fine>
Lastly, I check with command:
$ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- UU -- -- -- 1e --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
It's not return UU in section 1e. It's mean I configured wrong somewhere.
1. What should I do now ?
2. How can I get data from sensor assume that I configured correctly?
As I know that If a device connect correctly, data will display in: /sys/bus/iio/devices/. That's true ?
Thank you so much,
Toan
Hi Toan
one can check if SION bit is set for i2c signals, it is described
in IOMUX Chapter of i.MX6UL Reference Manual and check i2c signals
with oscilloscope.
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi igorpadykov,
My question is:
In my case, iMX6UL detected sensor but when It isn't notice that connection successfully. It's only show address of sensor is 1e. If connection is successfully, It will show UU instead of 1e.
Best regards,
Toan
Hi Toan
suggest to check i2c signals with oscilloscope.
Best regards
igor
Hi igorpadykov,
Actually, I don't have any scope. So, Do we have another way ?
Thank you so much,
Toan
Hi Toan
had you obtained (created) driver for that module :
https://www.raspberrypi.org/forums/viewtopic.php?t=184556
Best regards
igor