logo

Could not compile stylesheet for simplistic. Using last compiled stylesheet.

GPIO use

posted in Uncategorized
Tuesday, February 28 2012, 03:24 AM
miibpa
miibpa
Offline
0
Hello, I am using the linaro distribution and I am trying to use GPIO pins, I followed the howto in the wiki page [url=http://labs.igep.es/index.php/How_to_use_GPIOs]http://labs.igep.es/index.php/How_to_use_GPIOs[/url] but I obtanied the following errors:
[b]linaro@localhost:~/gpio/gpio-driver/module$[/b]
sudo insmod user-gpio-drv.ko insmod: error inserting \\\'user-gpio-drv.ko\\\': -1 Invalid module format
[b]linaro@localhost:~/gpio/gpio-driver/app$[/b]
./gpio input 136 gpio_init failed: No such file or directory please if you can give me some information about how to fix it, or another source of information about how to handle GPIO, I only need to get an input and output pin for logical levels. Thank you very much. Miguel
Responses (13)
  • Accepted Answer

    miibpa
    miibpa
    Offline
    Monday, March 05 2012, 12:46 PM - #permalink
    0
    I modified all makefile needed as: In module folder: CROSS_COMPILE ?= /usr/bin/arm-linux-gnueabi- KERNEL_PATH ?= /home/miguel/linux-omap-2.6.37-2 ARCH ?= arm In app folder: CROSS_COMPILE ?= /usr/bin/arm-linux-gnueabi- In lib folder: CROSS_COMPILE ?= /usr/bin/arm-linux-gnueabi- CC = $(CROSS_COMPILE)gcc AR = $(CROSS_COMPILE)ar Thank you very much
    The reply is currently minimized Show
  • Accepted Answer

    mcaro
    mcaro
    Offline
    Friday, March 02 2012, 09:22 PM - #permalink
    0
    How did you compile the gpio module? Manel
    The reply is currently minimized Show
  • Accepted Answer

    miibpa
    miibpa
    Offline
    Friday, March 02 2012, 09:10 PM - #permalink
    0
    Yes
    The reply is currently minimized Show
  • Accepted Answer

    mcaro
    mcaro
    Offline
    Friday, March 02 2012, 08:34 PM - #permalink
    0
    Did you compile the gpio kernel module for your kernel ?
    The reply is currently minimized Show
  • Accepted Answer

    miibpa
    miibpa
    Offline
    Friday, March 02 2012, 08:26 PM - #permalink
    0
    Afert downloading sources make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- igep00x0_defconfig make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage modules make ARCH=arm CROSS_COMPILE=arm-linux-gnuebai- modules_install INSTALL_MOD_PATH=/media/rootfs And then after compiling gpio drivers: linaro/gpio-driver/module#insmod user-gpio-drv.ko and return -1 with the previous error. Thank you. Miguel
    The reply is currently minimized Show
  • Accepted Answer

    Friday, March 02 2012, 01:30 AM - #permalink
    0
    Can you show us the exact commands that you are executing?
    The reply is currently minimized Show
  • Accepted Answer

    miibpa
    miibpa
    Offline
    Friday, March 02 2012, 12:31 AM - #permalink
    0
    Thanks to all of you for all the help, but i followed Manel instructions and wiki manuals [url=http://labs.igep.es/index.php/Linux_Kernel_2.6.37.y]http://labs.igep.es/index.php/Linux_Kernel_2.6.37.y[/url] and it\\\'s still not working, maybe I\\\'m doing any mistake installing modules, but everything seems correct. Regards, Miguel
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, March 01 2012, 07:14 PM - #permalink
    0
    You have to install the kernel *and* the modules as Manel said Regards, Javier
    The reply is currently minimized Show
  • Accepted Answer

    miibpa
    miibpa
    Offline
    Wednesday, February 29 2012, 09:39 PM - #permalink
    0
    I installed the kernel, and the insmod is still failing
    The reply is currently minimized Show
  • Accepted Answer

    mcaro
    mcaro
    Offline
    Wednesday, February 29 2012, 06:12 PM - #permalink
    0
    Appears that you don\\\'t have the right modules in your kernel in the rootfs: you should install the modules for your kernel as: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules_install INSTALL_MOD_PATH= Where if you\\\'re using a microsd card and it\\\'s mounted here: /media/rootfs The right command: sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules_install INSTALL_MOD_PATH=/media/rootfs Manel
    The reply is currently minimized Show
  • Accepted Answer

    miibpa
    miibpa
    Offline
    Wednesday, February 29 2012, 06:08 PM - #permalink
    0
    Thank you very much Javier, the compiling problem is solved, but again after following all the steps of the howto labs.igep.es/index.php/How_to_use_GPIOs this error is still appearing: linaro@localhost:~/gpio/gpio-driver/module$ sudo insmod user-gpio-drv.ko insmod: error inserting \\\'user-gpio-drv.ko\\\': -1 Invalid module format Any idea of why is it produced or how to solve it? Thank you very much Miguel
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, February 29 2012, 05:15 PM - #permalink
    0
    Hello miibpa, The CROSS_COMPILE environment variable is used to specific your cross compiler. For example: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage modules Then arm-linux-gnueabi- will be append to any GCC or binutils command such as gcc, ld, ar, nm, etc. If you don\\\'t have a cross-compiler toolchain. You can install one in ubuntu using: sudo apt-get install gcc-arm-linux-gnueabi Hope it helps, Javier
    The reply is currently minimized Show
  • Accepted Answer

    miibpa
    miibpa
    Offline
    Wednesday, February 29 2012, 10:43 AM - #permalink
    0
    I also got this error building kernel 2.6.37.y jdoe@ubuntu:~/linux-omap-2.6.37-1$ make ARCH=arm CROSS_COMPILE= uImage modules CHK include/linux/version.h CHK include/generated/utsrelease.h make[1]: `include/generated/mach-types.h\\\' is up to date. CC kernel/bounds.s cc1: error: unrecognized command line option \\\"-mlittle-endian\\\" cc1: error: unrecognized command line option \\\"-mabi=aapcs-linux\\\" cc1: error: unrecognized command line option \\\"-mno-thumb-interwork\\\" kernel/bounds.c:1: error: bad value (armv5t) for -march= switch kernel/bounds.c:1: error: bad value (armv5t) for -mtune= switch make[1]: *** [kernel/bounds.s] Error 1 make: *** [prepare0] Error 2 Any help please? I am a bit lost Thank you very much
    The reply is currently minimized Show
Your Reply

SUPPORT


This email address is being protected from spambots. You need JavaScript enabled to view it.
This email address is being protected from spambots. You need JavaScript enabled to view it.
IGEP Community Wiki
IGEP Community Forum
IGEP Community Online Chat