2017-06-23 06:24 AM
Hello,
I am interfacing SPI based LSM6DS3 accelerometer to imx7 based board. I got LSM6DS3 driver from '
https://github.com/STMicroelectronics/STMems_Linux_Input_drivers
'. Added device tree for this (kernel-4.1.15) as below.lsm6ds3@0{
compatible = 'st,lsm6ds3'; reg = <0>; spi-cpha; spi-cpol; spi-max-frequency = <50000>; interrupt-parent = <&gpio2>; interrupts = <26 IRQ_TYPE_EDGE_RISING>; status = 'okay'; };But still my device is not detected. i am getting error as 'LSM6DS3 : Who-Am-I value not valid'.
Next when i printed the valued of 'wai' , i got 0x0 , which should be 0x69.
Any suggestion
Thanks & regards
Surya
#accelerometer #lsm6ds3 #mems-accelerometer2017-06-23 07:36 AM
Hello, can you post the schematics to verify your design?
Do you have a logic analyzer to verify that the sensor works alone?
David
2017-06-23 07:49 AM
Hello David,
Its really not possible to share the schematic because of some NDA issues. But i can assure you about hardware connections. You can take reference of imx6 also.
One more thing - when i tried to comment the chip ID read register lines , the driver get probed , but still i am getting 0,0,0 values in accelerometer output which is false.
I have commented below lines in lsm6ds3_core.c probe function.
---------------------------------------------------------------------
if (wai ! = LSM6DS3_WHO_AM_I_DEF) {
dev_err(cdata->dev, 'Who-Am-I value not valid');
return -ENODEV;
}
---------------------------------------------------
Thanks & regards
Surya
2017-06-24 02:07 PM
Hello,
I would start with verifying that the sensor works, using an external logic analyzer.
Then, write your own simple code to read the WHO_AM_I register over SPI to verify your hardware. After that, focus on the firmware / drivers.
Are you able to debug your micro-controller?
David