cancel
Showing results for 
Search instead for 
Did you mean: 

[LSM303AGR] The compass does not work.

RChen.1654
Associate II

The LSM303AGR chip is used in Android device. 

I use STMems_Android_Sensor_HAL_Input sensor HAL from https://www.st.com/content/st_com/en/products/embedded-software/mems-and-sensors-software/drivers-for-mems/androidhalinput.html.

The magnetometer works but the compass does not work. The following logs appear when compass app is launched.

01-21 08:34:08.785 4367 4367 I CompassSensorActivity: ORIENTATION sensor not found

01-21 08:34:08.811 4367 4367 E SensorManager: sensor or listener is null

How do I configure ENABLED_MODULES in the Android.mk of STMems_Android_Sensor_HAL_Input ?

1 REPLY 1
RChen.1654
Associate II

I try to enable SENSOR_ST_COMPASS but there is building error due to lack of conf_COMPASS.h.

#if defined(SENSOR_ST_COMPASS)

 #include "conf_COMPASS.h"

#endif