I connected an FXOS8700CQR1 chip to the I2C bus of IMX8MP, but there was an error when the kernel loaded the driver。
The error message is as follows:
[ 2.326218] fxos8700 3-001e: read chip ID 0x1 is not equal to 0xc7 or 0xc4
[ 2.333122] fxos8700: probe of 3-001e failed with error -22
My devicetree setup like this:
Solved! Go to Solution.
Hi @WEI_LIU,
I hope you are doing well.
userspace application is not available.
However, One can use the ioctl call or poll input channels in the userspace application to read sensor data.
Please refer to below links :
http://trac.gateworks.com/wiki/accelerometer
https://wiki.openmoko.org/wiki/Accelerometer_data_retrieval
sysfs entries for the fxos8700 driver are also available.
Thanks & Regards,
Dhruvit Vasavada
Hi @WEI_LIU,
I hope you are doing well.
This error seems to be due to not properly reading Chip ID or incorrect Chip ID in fxos8700_probe().
Please share the schematic of the fxos8700 connection & pinctrl node (dts) for further debugging.
Could you please try to read CHIP ID using the i2c tools utility?
// i2cget -f -y <i2c_bus> <device_address> <device_register>
# i2cget -f -y 3 0x1e 0x0d
Thanks & Regards,
Dhruvit Vasavada
The result read by the i2c tools is: 0xc7
And this is my hardware design:
fxos8700 connected to the i2c4 node of the IMX8MP, no other pin connections.
And this is my dts configuration:
I compiled the driver as a module rather than into the kernel, and then loaded the driver manually, it seems works.
insmod fxos8700.ko
input: fxos8700 as /devices/platform/soc@0/30800000.bus/30a50000.i2c/i2c-3/3-001e/input/input1
fxos8700 device driver probe successfully
So, Is there a sample program to read data from the fxos8700 devide?
Thanks!
Hi @WEI_LIU,
I hope you are doing well.
userspace application is not available.
However, One can use the ioctl call or poll input channels in the userspace application to read sensor data.
Please refer to below links :
http://trac.gateworks.com/wiki/accelerometer
https://wiki.openmoko.org/wiki/Accelerometer_data_retrieval
sysfs entries for the fxos8700 driver are also available.
Thanks & Regards,
Dhruvit Vasavada