This repository has been archived by the owner on Nov 30, 2023. It is now read-only.
forked from STMicroelectronics/STMems_Android_Sensor_HAL_IIO
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README_hal
166 lines (124 loc) · 5.9 KB
/
README_hal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/* Android STMicroelectronics SensorHAL release 3.x
*
* Copyright (C) 2015-2019 STMicroelectronics
* Author: Denis Ciocca - <[email protected]>
*/
These are the release notes for STMicroelectronics SensorHAL version 3.
Read them carefully, as they tell you what this is all about, explain how
to install the dynamic library, and what to do if something goes wrong.
SOFTWARE REQUIREMENTS
Compiling, configuring and running the 3.x SensorHAL requires up-to-date
versions of various software packages.
Installing required packages: (used during `menuconfig`)
$ sudo apt-get install build-essential libncurses5-dev
HAL require two headers file from linux kernel. File can be found under
Documentation/iio-example-3.1x.y/. Copy files to linux/iio/
LIBS
In order to run some sensors in the application processor side, libraries
are needed. Run auto-extract script packages in the root folder of the HAL.
STMICROELECTRONICS LIBRARIES VERSION REQUIREMENTS:
- STAccCalibration: v1.x
- STMagCalibration: v1.x
- iNemoEngine_gbias_Estimation: v1.x
- iNemoEnginePRO: v1.x
- iNemoEngine_GeoMag_Fusion: v1.x
- STAccCalibration: v1.x
INSTALLING SOURCE CODE
Copy HAL source code into hardware/STMicroelectronics/SensorHAL_IIO folder.
During build process Android will include automatically the Android.mk.
In your device.mk (device/{vendor}/{board}/device.mk) adds package build
information:
PRODUCT_PACKAGES += sensors.{TARGET_BOARD_PLATFORM}
Note: device.mk can not read $(TARGET_BOARD_PLATFORM) variable, read and
replace the value from your BoardConfig.mk
CONFIGURING THE SENSOR HAL
--> To configure sensor the Sensor HAL IIO use mm utility from HAL root folder (only for Android version up to M included)
$mm sensors-defconfig (default configuration)
or
$mm sensors-menuconfig
--> For all the Android versions:
from <AOSP_DIR\> run the usual android build procedure:
source build/envsetup.sh
lunch <target version>
make
After the initial build of Android and SensorHAL, change directory to SensorHAL path and load initial Android settings
"source android_data_config"
than run make command with one of the following options:
"make sensors-defconfig" Set to default configuration
"make sensors-menuconfig" Text based color menus, radiolists & dialogs.
"make sensors-cleanconf" Delete hal_config, hal_config.old and configuration.h files.
COMPILING THE SENSOR HAL CODE
--> From SensorHAL_IIO root folder:
"mm" Build the code.
"mm -B" Force to rebuild all the code.
"mm DEBUG=y" Build SensorHAL in debug mode (no code optimization, generate map file).
--> From Android source code $TOP folder:
Just build Android source code as described on source.android.com. The SensorHAL will
be automatically build and installed into system.img
SENSORS SUPPORTED:
- ST Test sensors (Accel + Magn + Gyro);
- LSM6DSM (Accel + Gyro) + [optional Magn or Pressure on i2c master] + SC + SD + SM + Tilt;
- LSM6DSL (Accel + Gyro) + [optional Magn or Pressure on i2c master] + SC + SD + SM + Tilt;
- LSM6DS3 (Accel + Gyro) + [optional Magn or Pressure on i2c master] + SC + SD + SM + Tilt;
- LSM6DS33 (Accel + Gyro) + SC + SD + SM + Tilt;
- LSM6DS3H (Accel + Gyro) + [optional Magn or Pressure on i2c master] + SC + SD + SM + Tilt;
- LIS3MDL (Magn);
- LSM303DLHC (Accel + Magn);
- LIS3DH (Accel);
- LIS3DHH (Accel);
- LSM330D (Accel + Gyro);
- LSM330DL (Accel + Gyro);
- LSM330DLC (Accel + Gyro);
- LIS331DLH (Accel);
- LSM303DL (Accel + Magn);
- LSM303DLH (Accel + Magn);
- LSM303DLM (Accel + Magn);
- LSM330 (Accel + Gyro);
- LSM303AGR (Accel + Magn);
- LIS2DS12 (Accel) + SC + SD + SM + Tilt;
- LIS2DW12 (Accel)
- LIS2DG (Accel) + SC + SD + SM + Tilt;
- L3G4200D (Gyro);
- L3GD20 (Gyro);
- LPS331AP (Pressure);
- LPS25H (Pressure);
- LSM303AH (Accel + Magn);
- LPS22HB (Pressure);
- LPS22HD (Pressure);
- LPS22HH (Pressure);
- LPS27HHW (Pressure);
- LPS33HW (Pressure);
- LPS35HW (Pressure);
- LIS2HH12 (Accel);
- HTS221 (RHumidity + Temperature);
- LIS2MDL (Magn);
- LSM9DS1 (Accel + Gyro + Magn)
- LSM6DS0 (Accel + Gyro)
- LSM6DSO (Accel + Gyro) + [optional Magn or Pressure on i2c master] + SC + SD + SM + Tilt + Gesture;
- LSM6DSO32 (Accel + Gyro) + [optional Magn or Pressure on i2c master] + SC + SD + SM + Tilt + Gesture;
- LSM6DSR (Accel + Gyro) + [optional Magn or Pressure on i2c master] + SC + SD + SM + Tilt + Gesture;
- ASM330LHH (Accel + Gyro + Temp)
- LIS2DH (Accel);
- LIS2DH12 (Accel);
- ISM330DLC (Accel + Gyro) + [optional Magn or Pressure on i2c master] + Tilt;
- IIS2MDC (Magn);
- IIS2DH (Accel);
- ISM303DAC (Accel + Magn);
- IIS3DHHC (Accel);
SC: Step Counter, SD: Step Detector, SM: Significant Motion
CHANGELOG:
v3.0.0: First HAL revision
v3.1.0: Added selftest program, bugfix
v3.1.1: Added injection mode, changed way to decimate sensor data, added support lsm6dsm, bugfix
v3.1.2: Added support for new sensors (LSM6DS33, LSM6DS3H), install library under /system/vendor/lib/hw/,
bugfix on flush propagation using SW sensors, added wristtiltgesture sensor
v3.1.3: Added support for LSM303AH, LPS22HB. Fixed compiling issue on Android L and K (wrist-tilt)
v3.1.4: Added support for LIS2HH12, fix gbias lib sample processing and init
v3.1.5: Added support for Android N. Added support for different kernel versions
v3.1.6: Added support for Android O. Added support to Calibrated/Uncalibrated Acc.
v3.1.7: Added support for Android P.
v3.1.8: Added support to LPS22HH, LSM6DSO.
v3.1.9: Added support to ASM330LHH.
v3.1.10: New iio layer.
v3.1.11: Added support to LSM6DSR.
v3.1.12: Added support to LSM6DSO32.