This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Issues with HMC5883l 3 axis compass in custom blaze platform

Other Parts Discussed in Thread: 4460

Hi all,

I am using OMAP 4460 blaze platfrom with release notes (http://omappedia.org/wiki/4AI.1.3_OMAP4_Icecream_Sandwich_Release_Notes).

I am facing some issues with HMC5883l 3 axis compass.I am using hmc5843.c which is in android3.0/kernel/drvers/input/misc/hmc5843.c to make it work for HMC5883l. I am observing lot of flickering in needle and some times its not showing proper north direction.

Following are the modifications which i did in android3.0/kernel/drvers/input/misc/hmc5843.c according to hmc5883l data sheet

1.Swapped y and z axes

2. Sample intervals

Do i have to change anything else in the driver code apart from above mentioned points for supporting hmc5883l

Please help me in solving out this issue.

Best Regards

Abhijit

  • Abhijit,

    The driver for the HMC5883 is not included in the TI Android software releases.  However, there is an opensource version of the driver in kernel 3.5, and we have backported these patches to kernel 3.0 here: 

    http://review.omapzoom.org/#/q/status:open+project:kernel/omap+branch:p-android-omap-3.0-dev+topic:HMC5883_support,n,z

    As discussed in this thread http://e2e.ti.com/support/omap/f/849/p/212240/755605.aspx#755605, the HMC5843 driver used in the TI Android software releases is the one located in /drivers/input/misc/.  The HMC5883 driver from open source is located in /drivers/staging/iio/magnetometer.  Thus, you will need to modify the config to select this driver.  For example, you can:

    1) Apply the HMC5883 patches from the link above

    2) Change the device name from "hmc5843" to "hmc5883" in the Tablet kernel board file

    3) Remove the hmc5843 driver from /drivers/input/misc/ from compilation  (ie, comment out the line from the Makefile "obj-$(CONFIG_INPUT_HMC5843) += hmc5843.o")

    4) Select the driver in the menuconfig: Device Drivers -> Staging drivers -> Industrial I/O support -> Honeywell HMC5843/5883/5883L 3-Axis Magnetometer

    The new driver creates nodes in the path "/sys/bus/iio/devices/deviceX"________, where X-number of the iio device.  The driver must check all devices names: "/sys/bus/iio/devices/deviceX/________name", select device, named "hmc5883" and work with him via sysfs nodes, placed in "/sys/bus/iio/devices/deviceX/________"

    Note that the HMC5883 driver is not officially validated as part of the Blaze Tablet TI Android release, but hopefully you can use these patches as a starting point for your purposes.

    Regards,
    Gina 

  • Abhijit,

    Please note my reply above, which includes updated information.

    Regards,
    Gina 

  • Dear Gina,

    Thanks a lot for your inputs.

    But somehow i modified the hmc5843 driver code to make it work for hmc5883l.

    Thanks

    Abhijit