Hi,
I'm using LIS2DUX12 accelerometer on a custom PCB with SPI interface in a Linux environment and I was experiencing a failure during the probe of the device with error message [ 0.561627] st_lis2duxs12_spi spi0.0: unsupported whoami [ff]
Reading the datasheet documentation I found out that
When Vdd and Vdd_IO are set, the device enters a deep power-down state
So I read how to exit from a deep power-down state
If the SPI interface is used, the LIS2DUX12 can move from deep power-down to soft power-down by writing the
bit SOFT_PD of EN_DEVICE_CONFIG (3Eh) to 1
and took a look into the implementation of the function st_lis2duxs12_power_up_command(struct st_lis2duxs12_hw *hw) inside the file
st_lis2duxs12_core.c
To my surprise I found out that the code does not implement what's described in the documentation but instead was reading WHO_AM_I (0Fh) register.
To this SPI transaction the accelerometer does not respond and the MISO line stays high.
So, I tried to write EN_DEVICE_CONFIG (3Eh) to 1 instead and by doing so the probe returned with success!
I did this by putting the magic numer 0x3E as an argument to the regmap_write() function because there is no definition of that register address inside st_lis2duxs12.h file. Does this file, as well as others related to LIS2DUX12, need to be updated to reflect the latest changes with this device/documentation?
Hi, I'm using LIS2DUX12 accelerometer on a custom PCB with SPI interface in a Linux environment and I was experiencing a failure during the probe of the device with error message
[ 0.561627] st_lis2duxs12_spi spi0.0: unsupported whoami [ff]
Reading the datasheet documentation I found out thatSo I read how to exit from a deep power-down state
and took a look into the implementation of the function
st_lis2duxs12_power_up_command(struct st_lis2duxs12_hw *hw)
inside the file st_lis2duxs12_core.cTo my surprise I found out that the code does not implement what's described in the documentation but instead was reading WHO_AM_I (0Fh) register.
https://github.com/STMicroelectronics/st-mems-android-linux-drivers-iio/blob/d407e7b289169e5018ee8eefa774bc94fcc53073/drivers/iio/stm/accel/st_lis2duxs12_core.c#L313
To this SPI transaction the accelerometer does not respond and the MISO line stays high.
So, I tried to write EN_DEVICE_CONFIG (3Eh) to 1 instead and by doing so the probe returned with success! I did this by putting the magic numer 0x3E as an argument to the
regmap_write()
function because there is no definition of that register address insidest_lis2duxs12.h
file. Does this file, as well as others related to LIS2DUX12, need to be updated to reflect the latest changes with this device/documentation?Thanks