Sensor drivers and magd source code

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sensor drivers and magd source code

2,051 Views
huanxinjiang
Contributor I

Hi,

We noticed some confusing issues when developing sensor drivers (magnetic, accelerometer and gyroscope) based on the SabreSD board (i.MX6q) and the Android 5.0.1 GA release. We are using some sensor chip that integrates a magnetic sensor and an accelerometer, a different solution from the SabreSD board that uses separate components for both sensors. We noticed that there is a daemon called ‘magd’ (located at device/fsl-proprietary/sensor) that communicates with the drivers and does some management work on the sensors, including producing orientation sensor data.

The question is there is no source code of the magd daemon and it has made us hard to create our own HAL codes. Would it be possible for Freescale to share the source code of magd to us? It might also be helpful to share us any documents related to the magd daemon.

Another question is, besides the magnetic sensor, does magd handle any other sensors (such as gyroscope)?

Thanks and best regards,

Huanxin

Labels (2)
0 Kudos
8 Replies

1,173 Views
jamesbone
NXP TechSupport
NXP TechSupport

magd it is a freescale propiertary software for our products if you change to another sensor, it is not going to work and we do not share the source code of this software interface.

0 Kudos

1,173 Views
jerinsebastian
Contributor I

Hi jamesbone‌,

So, if I want to add a sensor, I need the modified magd daemon. right?

Thanks,

Jerin

0 Kudos

1,173 Views
2394343453
Contributor I

hi jamesbone,

       Mag3110 correction algorithm is integrated in the Hal layer ?   mag3110's correction algorithm is automatically collected data to  correction, or the upper app call an interface to call the Hal layer algorithm for correction ?.    And  is the magd  service deamon just  read mag3110 and g-sensor data to product the rotation,  and is it has correction algorithm function ?.

       Look forward to your reply.  thanks

BRS  

0 Kudos

1,173 Views
jamesbone
NXP TechSupport
NXP TechSupport

Hello Huanxin,

Unfortunately the magd  has been made for usage with the Freescale Sensors, and it is dependent of hardware so it, can not be handle by any other device. Regarding if magd, it is able to handle other sensors, like the gyroscope the answer is yes,  freescale offers the  FXAS21002|Freescale 3-Axis Digital Gyroscope|Freescale  and the Digital Sensor - 3D Accelerometer|Freescale


Have a great day,
Jaime

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,173 Views
huanxinjiang
Contributor I

Hi Jaime,

Here is more information about our solution:

1. We already selected the Digital Sensor - 3D Accelerometer|Freescale<http://jiveon.jivesoftware.com/mpss/c/0QA/PDcDAA/t.1pq/uvtFcNnkT-SlO3H4Fknhww/h4/LW-2BQREuanDlGerWANG3PZn40iui78tKFXjpGVV4HGibTiQ5H2mbFXj18RvWX38Zo2Fg2iZd1v63QdiTqC0DjTY3jKppsZvFyUhMG8OEVy58-3D>, but since there is no documentation about magd, we don’t know how to integrate it into the Android 5.0 code;

2. What we are doing is re-write our own HAL + Driver code, but it looks a big effort;

3. We are choosing another gyroscope device but can change to the FXAS21002|Freescale 3-Axis Digital Gyroscope|Freescale<http://jiveon.jivesoftware.com/mpss/c/0QA/PDcDAA/t.1pq/uvtFcNnkT-SlO3H4Fknhww/h3/LW-2BQREuanDlGerWANG3PZn40iui78tKFXjpGVV4HGibTiQ5H2mbFXj18RvWX38Zo2Fg2iZd1v63QdiTqC0DjTXGW6uSD5wRayEq9-2FEmxyns-3D>, the same issue is we don’t have the information on how to integrate it with magd.

So, it would be great if you can provide detailed documentation of magd.

Thanks,

Huanxin

0 Kudos

1,173 Views
jamesbone
NXP TechSupport
NXP TechSupport

Hello Huanxin,

Here are some details on how to Add magd Service to Android

1.- add magd source

Copy magd direction to Android_dir/hardware/mx5x/

2.- Add magd service

Add the following code in init.rc to run magd service

service magdservice /system/bin/magd

user root

group root

onshot

3. Compile the kernel and Android system.

4.- Use Eyes.apk to test sensors.

0 Kudos

1,173 Views
huanxinjiang
Contributor I

Hi James,

Thanks for the information. The question is we don’t have source of magd (there is just an executable binary: /device/fsl-proprietary/sensor/magd).

We are using Android 5.0.1 GA release for i.MX6, and the magd service has already been configured in init.rc.

What we are not sure is, after changing the accelerometer and magnetic sensors (different from the reference design, the SabreSD board), and adding a gyroscope sensor, what should we do to configure the magd to make all things run? Is there any document about this?

Thanks,

Huanxin

0 Kudos

1,173 Views
huanxinjiang
Contributor I

Hi Jaime,

Thanks a lot for the quick response. Is there any documentation about the magd? And if we choose other devices, we need to write our own HAL code, and since there is no source code of magd for reference, do you have any suggestions?

Best regards,

Huanxin

0 Kudos