cancel
Showing results for 
Search instead for 
Did you mean: 

integration of lsm303AGR on Android 10 and kernel 5.4 versions

prasannakulkarni
Associate

Dear Team,

We are integrating lsm303AGR accelerometer and magnetometer sensors on NXP's imx8 Android 10 platform.

https://github.com/STMicroelectronics/st-mems-android-linux-sensors-hal for HAL

https://github.com/STMicroelectronics/st-mems-android-linux-drivers-iio for linux 5.4 kernel

device registers as iio:device0 and iio:device1 x,y,z raw value we can see in cat sysfs files.

HAL finds 2 IIO devices but further

there is lack of implementation of loading bias and save bias functions in legacy 

because of this the sensors app is not able to  read the sensor data values . apps says there are 2 sensors from stm accel and magn but data is not able to read.

it is going into un-calibrated type. 

kindly help us in fixing the issue.

6 REPLIES 6
Federica Bossi
ST Employee

Hi @prasannakulkarni ,

Can you check if the Linux driver works correctly on your platform?
To verify this, once the sensor is activated, the accelerometer or magnetomer interrupts must increment regularly, otherwise there could be an issue with the configuration of the interrupt lines in the device tree. To see if the interrupts are triggered regularly, you can read the file/proc/interrupts, checking for example if the lsm303agr_accel counter increases.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Yes you are true, interrupts are getting incremented. kindly find the attached files there are no implementations for loadbias and savebias in legacy mode

legacy/SensorsLegacyInterface.cpp


/**
247 * onSaveDataRequest: receive data to store,
248 * reference: ISTMSensorsCallbackData class
249 */
250 int SensorsLegacyInterface::onSaveDataRequest(const std::string& resourceID,
251 const void *data, ssize_t len)
252 {
253 (void) resourceID;
254 (void) data;
255 (void) len;
256
257 return -EIO;
258 }
259
260 /**
261 * onLoadDataRequest: load data from disk,
262 * reference: ISTMSensorsCallbackData class
263 */
264 int SensorsLegacyInterface::onLoadDataRequest(const std::string& resourceID,
265 void *data, ssize_t len)
266 {
267 (void) resourceID;
268 (void) data;
269 (void) len;
270
271 return -EIO;
272 }

Screenshot from 2025-02-21 19-40-56.png

Screenshot from 2025-02-21 19-41-12.png

Screenshot from 2025-02-21 19-41-33.png

   

Screenshot from 2025-02-21 19-42-34.png

Screenshot from 2025-02-21 19-42-51.png

Screenshot from 2025-02-21 19-43-12.png

   

Screenshot from 2025-02-21 19-43-26.png

Screenshot from 2025-02-21 19-52-45.png

  

prasannakulkarni
Associate

Kindly help