Personal tools

Log in

Changes

From IGEP - ISEE Wiki

Jump to: navigation, search

How to use GPIOs

134 bytes added, 14:00, 9 January 2012
no edit summary
<pre>wget -r -np http://svn.hylands.org/linux/gpio/
</pre>
Due the source Makefiles are wrote implemented for Gumstix SDK, it is necessary change some constants to for compile with our Host. There These constants are:  In files:
$/svn.hylands.org/linux/gpio/app/Makefile
CROSS_COMPILE ?= $(OVEROTOP)/tmp/sysroots/x86_64-linux/usr/armv7a/bin/arm-angstrom-linux-gnueabi-
</pre>
Replace Replaced by, your cross compiler path, for example:
<pre>OVEROTOP ?= /
CROSS_COMPILE ?= $(OVEROTOP)/usr/bin/arm-linux-gnueabi-
</pre>
In file:<br>
 
$/svn.hylands.org/linux/gpio/modules/Makefile<br>
KERNEL_PATH &nbsp;?= ../../../../../gumstix/overo-oe/tmp/sysroots/overo-angstrom-linux-gnueabi/kernel
ARCH ?= arm</pre>
Replace Replaced by, your cross compiler path and your kernel source used path used, for example:
<pre>OVEROTOP ?= /
#CROSS_COMPILE ?= $(OVEROTOP)/tmp/cross/armv7a/bin/arm-angstrom-linux-gnueabi-
KERNEL_PATH &nbsp;?= ../../../../../&lt;your kernel source path used&gt;
ARCH ?= arm</pre>
Go to: $/svn.hylands.org/linux/gpio/Makefile and compile app, lib and module all source code downloaded using make command. <br>
Transfer Send binaries created from Host to IGEP Igep v2. <br>
= Install binaries =
 
Install binaries via root user.
=== Install module ===
<pre>insmod user-gpio-drv.ko
</pre>
Check that user-gpio-drv.ko is currently loaded with the following command:<pre>lsmod</pre> The module is loaded until system halt.
=== Install dynamic library ===
Go to:$/svn.hylands.org/linux/gpio/lib/. libgpio.so will be found here. You must tell to SO where the dynamic libraries are. Now we define the environment variable LD_LIBRARY_PATH for SO can link a library with a program when a program make a call. Type the follow commnad:<pre>export LD_LIBRARY_PATH=/root/svn.hylands.org/linux/gpio/lib/</pre>
You must tell to SO where the dynamic libraries are. Now we define the environment variable LD_LIBRARY_PATH for SO can link a library with a program when a program make a call. Type the follow commnad:
<pre>export LD_LIBRARY_PATH=/root/svn.hylands.org/linux/gpio/lib/
</pre>
=== Execute app<br> ===
<pre> ldd gpio
</pre>
See if libgpio.so is found it. If you execute program in bash without linking library dependencies, bash give you a error message.
= Testing driver =
<br> <br>
'''Under construction'''<br>
'''Under construction'''<br>
<br>
<br> Example:[[What can I do with IGEP0020#How_to_handle_the_gpio-LED.27s]]
[[Category:Work_in_progress]] [[Category:Communications]]
4,199
edits