Sensors for OMAP
 Sensors for OMAP
The goal of the project is to enable different sensors for OMAP, be it an internal accelerometer built into Zoom2/OMAP4 or other external sensors. This could be adding a driver for the sensor or extending the support from the UI framework.
 Sensors on OMAP4 SDP and Blaze
OMAP4 based boards (SDP and Blaze) support several sensors like Accelerometer, Ambient Light sensor, Proximity Switch, Temperature sensor, Pressure sensor, Digital compass. Below wiki link provides details of driver support for each.
 Accelerometers on OMAP Zoom2
This project is to enable the Accelerometer sensor (Bosch BMA150 Accelerometer Sensor Driver) in Zoom2 by adding a driver for it on LO kernel.
There are two accelerometers built into OMAP Zoom2: a MEMSIC and a Bosch
* http://omapzoom.org/platform.html * MEMSIC Sensors - Accelerometer - http://www.memsic.com/products/MXC6202.htm * Bosch Accelerometer - http://www.bosch-sensortec.com/content/language1/downloads/BMA150_DataSheet_Rev.1.5_30May2008.pdf
 Bosch Accelerometer
This sub-section describes how to get Bosch Accelerometer drivers and instructions on integrating them in L-O Kernel. The drivers were tested with L-O 2.6.31-rc5 kernel.
The source files for Bosch BMA150 drivers are located at: http://github.com/phukat/AccelDriver.
To download the source files for the driver in either tar or zip format go to: http://github.com/phukat/AccelDriver/archives/master.
After downloading the drivers un-compress them and follow below instructions for copying them to appropriate location and compile them in to kernel. The below instructions assume that the L-O kernel is downloaded at <kernel-location> directory. They also assume the unzipped or untared version of the drivers are available at <bma150-download-dir> directory.
cd <bma150-download-dir> cp bma150.c <kernel-location>/drivers/input/misc/. cp smb380.c <kernel-location>/drivers/input/misc/. cp smb380calib.c <kernel-location>/drivers/input/misc/. cp smb380calib.h <kernel-location>/drivers/input/misc/. cp smb380.h <kernel-location>/include/linux/. // Modify the Makefile in <kernel-location>/drivers/input/misc/ direcotry and add below line at the end // obj-$(CONFIG_BOSCH_BMA150) += smb380.o smb380calib.o bma150_driver.o // Modify Kconfig file in <kernel-location>drivers/input/misc directory and add below code-segment before the last endif // config BOSCH_BMA150 tristate "SMB380/BMA150 acceleration sensor support" depends on I2C=y help If you say yes here you get support for Bosch Sensortec's acceleration sensors SMB380/BMA150. // Modify the file omap_zoom2_defconfig in <kernel-location>/arch/arm/configs/ directory and add below line at the end // CONFIG_BOSCH_BMA150=y
After you followed the above instructions please do "make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm menuconfig" and enable BMA150 by drilling down to and selecting device drivers -> input device support -> Miscellaneous devices -> Bosch BMA150 Accelerometer. Save the config and rebuild the kernel by giving the command " make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm uImage"
 External Sensors
Additional sensors can be attached to the OMAP Zoom platforms through the J43 expansion header. This can come in handy for testing a part's capability in a near-production environment, with a custom operating system and hardware similar to what you would find in a current consumer device. Here is a brief list of steps for integrating a new sensor into the Zoom:
- Hardware integration and pin connection
- Refer to the applicable Zoom Baseboard Schematic (available from LogicPD after kit registration)
- Addition of driver source and header files to kernel source
- Driver.c goes into an appropriate drivers/ subdirectory
- Driver.h can go into include/linux or an appropriate subdirectory thereof
- Modification of Makefile and Kconfig in the destination drivers/ directory
- Follow patterns from existing entries to create new ones
- Pin mux configuration
- Refer to OMAP3430 datasheet (padconf table begins on page 768)
- Modify arch/arm/mach-omap2/mux.c and arch/arm/plat-omap/include/plat/mux.h appropriately
- Modification of the board configuration file
- Initialize GPIO and communication protocol pins, any device-specific platform data, and bind the driver to the communication adapter
- Kernel compilation and test
Note that this list assumes familiarity with retrieving the kernel and bootloader source, cross-compiling the binaries, formatting an SD card and booting the Zoom platform as outlined in the Getting Started sections of this website.
Further details on the integration process can be found in this patchset on the Linux-OMAP Kernel:
--Chudson 22:37, 7 January 2010 (UTC)
 Kionix KXTE9 Accelerometer
The first sensor I integrated into the OMAP Zoom platform was the Kionix KXTE9 digital tri-axis accelerometer. This part uses i2c and has built-in tilt position, wake-up, and back-to-sleep algorithms, which can trigger a user-configurable physical interrupt. I used Digi-key part number SAM8019-ND to interface with the J43 expansion header on the zoom, and connected the pins to a 14-pin header that was attached to a KXTE9 evaluation board via a ribbon cable. Here are the exact pin connections:
To test the driver and hardware connections, I used Busybox on the ZoomI and ZoomII platforms. Mounting a Busybox filesystem allows you to boot into a custom Linux kernel and perform most of the same commands that you have available on your desktop distro. Before you get to this point, (if writing a custom driver) you will probably spend a lot of time compiling, configuring, recompiling, and rebooting your kernel to debug any problems with the driver or hardware connections. Once the kernel is scanning the appropriate communication bus, finding the external sensor, and binding the driver to it properly, you can use cd, ls, cat, echo, etc...if you're using sysfs, you can directly control your hardware from the serial terminal using these commands. Placing debug outputs into the driver code will allow straightforward confirmation that the sysfs attribute functions are being called and executed correctly as you are manipulating them through Busybox.
The KXTE9 product specification is available here:
KXTE9 Evaluation Boards are available here:
--Chudson 22:37, 7 January 2010 (UTC)
Zoom2 platform resources - http://omapzoom.org/resources.html
Zoom2 Board Schematics - https://gforge.ti.com/gf/project/omapzoom/frs/?action=FrsReleaseBrowse&frs_package_id=48
Accelerometer Fundamentals - http://wiki.openmoko.org/wiki/Technical:Accelerometer_Fundamentals
Accelerometer Data Retrieval - http://wiki.openmoko.org/wiki/Accelerometer_data_retrieval
Bosch Sensortec BMA150 Digital, triaxial acceleration sensor - http://www.bosch-sensortec.com/content/language1/downloads/Flyer_BMA150_november07.pdf
Odroid Entertainment device - Android based gaming device - Odroid uses Bosch BM150 http://www.hardkernel.com/ http://www.linuxfordevices.com/c/a/News/HardKernel-Odroid/
Odroid Hardware Information - http://dev.odroid.com/projects/odroid/wiki/HardwareInformation
BMA150 device driver source code - http://dev.odroid.com/projects/linux/src/drivers/input/misc
Discussion on New style I2C driver for KXSD9 accelerometer - http://osdir.com/ml/linux.drivers.i2c/2008-09/msg00080.html
Debugging Kernels - Console Server and KERN_ messages - http://wil.cs.caltech.edu/mwiki/index.php?title=Console_server
Usage on iPhone - http://news.cnet.com/8301-13924_3-10251217-64.html
 Future additions
Once the driver is in place, use cases can be enabled from UI framework on any supported distributions.