Accelerometer Porting

110 views
Skip to first unread message

Gianmaria Iaculo

unread,
Dec 2, 2019, 9:54:55 AM12/2/19
to android-porting
Good morning,
I need a little help with accelerometer porting, I'm new to this task and right now I'm a little bit confused. I've read the documentation on Google Sensors Stack here: https://source.android.com/devices/sensors/sensor-stack
but I'm not able to go ahead. 

Actually I've my accelerometer (Freescale MMA8451) connected to I2C and correctly working, my kernel drivers are loaded and i can see under /sys/class/input/input2  enable, name and so on. I can set enable = 1 with cat and I can read values with getevent. 

Now the hard part.. I have to add this to the HAL, cause android continues to say "no accelerometer connected". It's not clear to me what are the following steps.

1) What to add in sensors.h
2)Do I need a sensor.cpp ? Or kernel drivers are enough?
3) What else? 


Any help or hint will be appreciated. 

Gianmaria 

Tranphong Vu

unread,
Dec 3, 2019, 2:48:03 PM12/3/19
to gianm...@nventa.it, android-porting
Hi Gianmaria,
You need a HAL sensor implement to let Android system know that there is sensor in kernel.
You can refer to this HAL sensor implement http://androidxref.com/9.0.0_r3/xref/hardware/invensense/65xx/

Thanks,
Vu Tran

Vào Th 2, 2 thg 12, 2019 vào lúc 21:54 Gianmaria Iaculo <gianm...@nventa.it> đã viết:
--
--
unsubscribe: android-porti...@googlegroups.com
website: http://groups.google.com/group/android-porting

---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-porti...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/4751ca88-e0dd-4a88-8902-c6abdc3cce0b%40googlegroups.com.

Gianmaria Iaculo

unread,
Dec 6, 2019, 11:40:32 AM12/6/19
to android-porting
Thank you,
i used the implementation you suggested. Now I have  a sensors.imx8.so compiled, and present in /vendor/lib/hw, but anyway no accelerometers were detected by android... what are the next steps? :(

Regards,
Gianmaria


Il giorno martedì 3 dicembre 2019 20:48:03 UTC+1, Tranphong Vu ha scritto:
Hi Gianmaria,
You need a HAL sensor implement to let Android system know that there is sensor in kernel.
You can refer to this HAL sensor implement http://androidxref.com/9.0.0_r3/xref/hardware/invensense/65xx/

Thanks,
Vu Tran

Vào Th 2, 2 thg 12, 2019 vào lúc 21:54 Gianmaria Iaculo <gianm...@nventa.it> đã viết:
Good morning,
I need a little help with accelerometer porting, I'm new to this task and right now I'm a little bit confused. I've read the documentation on Google Sensors Stack here: https://source.android.com/devices/sensors/sensor-stack
but I'm not able to go ahead. 

Actually I've my accelerometer (Freescale MMA8451) connected to I2C and correctly working, my kernel drivers are loaded and i can see under /sys/class/input/input2  enable, name and so on. I can set enable = 1 with cat and I can read values with getevent. 

Now the hard part.. I have to add this to the HAL, cause android continues to say "no accelerometer connected". It's not clear to me what are the following steps.

1) What to add in sensors.h
2)Do I need a sensor.cpp ? Or kernel drivers are enough?
3) What else? 


Any help or hint will be appreciated. 

Gianmaria 

--
--

website: http://groups.google.com/group/android-porting

---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages