Hilfe beim Kompilieren von cp210x.ko

  • Hallo

    baue grade einen Fhem server auf mit dem Raspberry und möchte meinen Strommesser integrieren.
    Dazu gibt es eine anleitung:

    http://www.meintechblog.de/2013/10/smart-…tromverbrauchs/

    wenn ich jedoch den Usb Treiber aktualisieren möchte kommt die fehlermeldung:
    ERROR: could not insert 'cp210x': Exec format error

    wer kann mir beim Kompilieren der datei ( für ne kleine Spende ) behilflich sein.
    hab so gut wie keine Linux kentnisse wäre also gut per teamviewer.de und Skype oder so

    eine Anleitung ist hier:

    Run

    ./install.sh

    to install the pre compiled cp210x driver kernel module.
    This will only work on a raspbian 3.6.11 kernel (2013-02-09-wheezy-raspbian.zip).
    If this does not work on your raspberypi then you
    will need to compile the driver for the kernel version that you have
    installed. Some details of how this may be done are shown below.


    BUILDING THE RASPBERRYPI cp210x DRIVER

    The following details how the cp210x driver may be rebuilt. It also
    serves as a basic guide to cross compiling the raspberrypi kernel.

    This guide assumes
    - You have an Ubuntu 12.04 machine
    - You have a raspberrypi running raspybian (either the 3.2.27+ or the 3.6.11+ kernel)
    - You have the ssh server on the raspberrypi and the Ubuntu machine and they are
    connected to the same IP network.
        
    When complete the raspberrypi will be able to run the cm160server and the Ubuntu
    machine will be able to run the electricowl GUI.

    ON THE RASPBERRYPI
    Grab the current kernel configuration as follows
    - From a terminal window or ssh session, take a copy of the current kernel configuration using the following command.
    zcat /proc/config.gz > /tmp/.config
    - Copy the current kernel configuration to the Ubuntu machine
    scp /tmp/.config <USERNAME>@<UBUNTU MACHINE IP ADDRESS>:/tmp
    replace <USERNAME> with your username on the Ubuntu machine and
    <UBUNTU MACHINE IP ADDRESS> with its IP address.


    ON THE UBUNTU MACHINE
    Cross compile the raspberrypi kernel as follows
    - cd ~
    - mkdir raspberrypi_kernel
    - cd raspberrypi_kernel
    - sudo apt-get install git (only required if git is not installed on your ubuntu machine)
    - git clone --depth 1 git://http://github.com/raspberrypi/linux.git
    - git clone git://http://github.com/raspberrypi/tools.git
    - cd linux
    - git fetch
    - git checkout rpi-3.2.27 (for the 3.2.27 kernel) or git checkout rpi-3.6.y (for the 3.6.11 kernel)
    - Edit the Makefile (in the current folder) and
    Change the following line
    HOSTCXXFLAGS = -O2
    to
    HOSTCXXFLAGS = -O2 -mfpu=vfp -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s
    - PATH=$PATH:$HOME/raspberrypi_kernel/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin
    - make mrproper
    - cp /tmp/.config .
    - make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
    Enter return to select the default option for each kernel option presented

    The raspberrypi kernel will then be built, this will take some time....

    Now that the kernel has been built we need to copy the cp210x driver source code into the kernel
    source tree and compile it. The following cmds detail how this may be done.

    - mv ~/raspberrypi_kernel/linux/drivers/usb/serial/cp210x.c /tmp/cp210x.c.org
    - copy the cp210x.c (from the tarball) file to ~/raspberrypi_kernel/linux/drivers/usb/serial/cp210x.c
    - make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

    This time only the new cp210x driver will be rebuild, this shouldn't take long

    - Copy the cp210x kernel module to the raspberry pi using the following command
    scp drivers/usb/serial/cp210x.ko pi@192.168.0.115:/tmp
    (The IP address should be the IP address of the raspberrypi)

    ON THE RASPBERRYPI
    The modified cp210x kernel driver needs to be copied from /tmp/cp210x.ko to its correct location.
    by running the following commands from a terminal on the raspberry pi. The 3.2.27+ text should be
    substituted with 3.6.11+ if the raspbery pi has a 3.6.11 kernel.

    - sudo mv /lib/modules/3.2.27+/kernel/drivers/usb/serial/cp210x.ko /lib/modules/3.2.27+/kernel/drivers/usb/serial/cp210x.ko.old1
    - sudo cp /tmp/cp210x.ko /lib/modules/3.2.27+/kernel/drivers/usb/serial/cp210x.ko
    - Edit the /etc/modules file and add the following line to the end of the file to ensure the cp210x module is loaded on restart
    cp210x
    - Remove the previous cp210x kernel driver
    sudo rmmod cp210x
    - Add the modified cp210x kernel driver
    sudo modprobe cp210x


    Note !!!
    If you run 'sudo modprobe cp210x' and get the following error then you have probably compiled the
    cp210x module for the wrong processor architecture. Check that you edited the Makefile as detailed
    in the steps above.

    ERROR: could not insert 'cp210x': Exec format error

    Danke Gruß Josty

Jetzt mitmachen!

Du hast noch kein Benutzerkonto auf unserer Seite? Registriere dich kostenlos und nimm an unserer Community teil!