Accelerometer Porting

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Accelerometer Porting

Gianmaria Iaculo-3
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 

--
--
unsubscribe: [hidden email]
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/4751ca88-e0dd-4a88-8902-c6abdc3cce0b%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Accelerometer Porting

Tranphong Vu
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 <[hidden email]> đã 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 

--
--
unsubscribe: [hidden email]
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/4751ca88-e0dd-4a88-8902-c6abdc3cce0b%40googlegroups.com.

--
--
unsubscribe: [hidden email]
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/CADfFnWh%3DSAa8%2BbpJWdHk-QyO42mXVQqgF4M5cHi2uQeArF%3DeMg%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Accelerometer Porting

Gianmaria Iaculo-3
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 <a href="http://androidxref.com/9.0.0_r3/xref/hardware/invensense/65xx/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fandroidxref.com%2F9.0.0_r3%2Fxref%2Fhardware%2Finvensense%2F65xx%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEUyiPgKmHONdbM0iMLKjXCwzoIWQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fandroidxref.com%2F9.0.0_r3%2Fxref%2Fhardware%2Finvensense%2F65xx%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEUyiPgKmHONdbM0iMLKjXCwzoIWQ&#39;;return true;">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 <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="aPBU6ewvAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">gianm...@...> đã 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: <a href="https://source.android.com/devices/sensors/sensor-stack" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://source.android.com/devices/sensors/sensor-stack&#39;;return true;" onclick="this.href=&#39;https://source.android.com/devices/sensors/sensor-stack&#39;;return true;">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 

--
--
unsubscribe: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="aPBU6ewvAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">android...@googlegroups.com
website: <a href="http://groups.google.com/group/android-porting" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://groups.google.com/group/android-porting&#39;;return true;" onclick="this.href=&#39;http://groups.google.com/group/android-porting&#39;;return true;">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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="aPBU6ewvAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">android...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/android-porting/4751ca88-e0dd-4a88-8902-c6abdc3cce0b%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/android-porting/4751ca88-e0dd-4a88-8902-c6abdc3cce0b%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/android-porting/4751ca88-e0dd-4a88-8902-c6abdc3cce0b%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/android-porting/4751ca88-e0dd-4a88-8902-c6abdc3cce0b%40googlegroups.com.

--
--
unsubscribe: [hidden email]
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/837982bc-f088-4d1f-a47f-b1b6fd1b4e58%40googlegroups.com.