Problem with installation driver in Linux

Discussion in 'Embedded Systems and Microcontrollers' started by Peter Pan, Jun 5, 2009.

  1. Peter Pan

    Thread Starter Senior Member

    Mar 24, 2005
    122
    0
    Hello All,

    I am newbie in Linux and need some help in installation of driver of the UM245R FTDI device (this one http://www.ftdichip.com/Products/EvaluationKits/UM245R.htm ).

    Installation instruction says:

    ---------------------------------------------
    1. Create a temporary folder in your linux machine.
    2. Extract the files from ftdi_sio.tar.gz file to your temporary folder
    "gunzip ftdi_sio.tar.gz"
    "tar -xvf ftdi_sio.tar"
    3. Build the driver
    "make"
    4. Plug in your ftdi device
    5. Check to see if default driver was loaded
    "lsmod" - you will see ftdi_sio if a driver is loaded
    6. Remove the default installed driver
    "rmmod ftdi_sio"
    7. Install the newly built driver
    "insmod ftdi_sio.o"
    ---------------------------------------

    Ihave done steps 1 and 2 and got the files:

    ftdi_sio.c
    ftdi_sio.h
    Makefile
    Rules

    and do not understand what exactly I has to do with these according to step 3? :confused:(Step 3 is: Build the driver "make").

    Thank you.
     
  2. bertus

    Administrator

    Apr 5, 2008
    15,646
    2,345
    Hello Vladimir,

    What distro of linux are you using?
    Did you install the kernel source?
    Do you have the GCC installed?
    Where you superuser at the moment of the compiling?

    Greetings,
    Bertus
     
  3. Peter Pan

    Thread Starter Senior Member

    Mar 24, 2005
    122
    0
    Hi Bertus,

    I use Linux XP professional (kernel 2.4.2) installed on PC.
    GCC is installed and I logged in as root.
     
  4. bertus

    Administrator

    Apr 5, 2008
    15,646
    2,345
    Hello Vladimir,

    How old is the distro?
    The current linux xp uses a 2.6.22 kernel.

    http://distrowatch.com/table.php?distribution=linuxxp

    It can happen that the driver will not work with a 2.4 kernel.

    Did you install the kernel source?
    Without the kernel source the driver can not be installed.

    I just looked in the readme:
    NOTES:
    1.This driver was adapted from the 2.4.32 kernel to support both the 2232C and 232R chip
    2.There is no need to follow this procedure if you want 232R chip supprt. The 232BM driver will
    be sufficient.Changes made to the driver for the 232R chip are purly cosmetic (plug/unplug will appear as a 232R chip in
    the kernel log).

    The driver is made for the 2.4.32 kernel.

    Greetings,
    Bertus
     
    Last edited: Jun 5, 2009
  5. Peter Pan

    Thread Starter Senior Member

    Mar 24, 2005
    122
    0
    Yes, the version of kernel is few years old, I agree. However, for my purposes (which is organisation of data exchange between PC and microcontroller in order control of NMR pulse programmer) it's quite enough.
    My program on PC which will communicate with microcontroller will be written in C and its GUI will be written in Tk shell.

    FTDI Web site http://www.ftdichip.com/Drivers/VCP.htm says that the device (FT245R) which I am going to use is supported in Linux by the version of driver (1.5.0) which I am trying to install.

    I am not sure how to answer the question
    "Did you install the kernel source?" as all I did is installation of Linux distributive.
     
  6. bertus

    Administrator

    Apr 5, 2008
    15,646
    2,345
    Hello Vladimir,

    In each linux there is a possiblility to add and remove programs using a "package manager".
    In this package manager you can search for the available programs.
    You will have to look for the "kernel source".
    The kernel source contains the source code for the kernel.
    This code is used to link the driver to the kernel.
    This is done to let the kernel have control over the driver.

    Greetings,
    Bertus

    PS I see that you have to buy linux XP.
    There are a lot of free distributions as well.
    I use OpenSuse at the moment.
     
  7. bertus

    Administrator

    Apr 5, 2008
    15,646
    2,345
    Hello Vladimir,

    It is important that the version of the kernel source is the same as the installed kernel.
    In the kernel source there is information for the driver how and where to link.

    Greetings,
    Bertus
     
    Last edited: Jun 6, 2009
  8. Peter Pan

    Thread Starter Senior Member

    Mar 24, 2005
    122
    0
    Hi Bertus,

    I think that I have installed kernel source because during installation I had chosen 'Install everything' option.
     
  9. bertus

    Administrator

    Apr 5, 2008
    15,646
    2,345
    Hello Vladimir,

    I have tried it at home, but I also did not succeed.
    You must use the make command.

    Code ( (Unknown Language)):
    1.  
    2. bert@PC4800:~> su
    3. Wachtwoord:
    4. PC4800:/home/bert # cd Download/Electronica/Software/FDTI/ftdi_sio/
    5. PC4800:/home/bert/Download/Electronica/Software/FDTI/ftdi_sio # ls
    6. ftdi_sio.c  ftdi_sio.h  Makefile  Rules.make
    7. PC4800:/home/bert/Download/Electronica/Software/FDTI/ftdi_sio # make
    8. gcc -Wall -D__KERNEL__ -DMODULE -I/lib/modules/2.6.22.19-0.2-default/build/include -D__SMP__ -DSMP -DMODVERSIONS -include /lib/modules/2.6.22.19-0.2-default/build/include/linux/modversions.h -I/usr/src/linux-2.6.22.19-0.2-default/drivers/usb/serial/ -O   -c -o ftdi_sio.o ftdi_sio.c
    9. cc1: error: /lib/modules/2.6.22.19-0.2-default/build/include/linux/modversions.h: Bestand of map bestaat niet
    10. ftdi_sio.c:253:24: error: linux/init.h: Bestand of map bestaat niet
    11. ftdi_sio.c:254:24: error: linux/slab.h: Bestand of map bestaat niet
    12. ftdi_sio.c:256:30: error: linux/tty_driver.h: Bestand of map bestaat niet
    13. ftdi_sio.c:257:28: error: linux/tty_flip.h: Bestand of map bestaat niet
    14. ftdi_sio.c:258:26: error: linux/module.h: Bestand of map bestaat niet
    15. ftdi_sio.c:259:28: error: linux/spinlock.h: Bestand of map bestaat niet
    16. ftdi_sio.c:260:25: error: asm/uaccess.h: Bestand of map bestaat niet
    17. ftdi_sio.c:261:23: error: linux/usb.h: Bestand of map bestaat niet
    18. ftdi_sio.c:263:30: error: linux/usb/serial.h: Bestand of map bestaat niet
    19. ftdi_sio.c:274: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘vendor’
    20. ftdi_sio.c:275: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘product’
    21. ftdi_sio.c:282: error: expected specifier-qualifier-list before ‘__u16’
    22. ftdi_sio.c:312: warning: ‘struct usb_serial’ declared inside parameter list
    23. ftdi_sio.c:312: warning: its scope is only this definition or declaration, which is probably not what you want
    24. ftdi_sio.c:316: warning: ‘struct usb_serial’ declared inside parameter list
    25. ftdi_sio.c:321: warning: initialization from incompatible pointer type
    26. ftdi_sio.c:350: error: array type has incomplete element type
    27. ftdi_sio.c:351: warning: implicit declaration of function ‘USB_DEVICE’
    28. ftdi_sio.c:441: error: field name not in record or union initializer
    29. ftdi_sio.c:441: error: (near initialization for ‘id_table_combined’)
    30. ftdi_sio.c:441: error: ‘kernel_ulong_t’ undeclared here (not in a function)
    31. ftdi_sio.c:443: error: field name not in record or union initializer
    32. ftdi_sio.c:443: error: (near initialization for ‘id_table_combined’)
    33. ftdi_sio.c:578: error: field name not in record or union initializer
    34.  
    My kernel seems to be incompatable with the driver.
    It can not find some files and link are not correct.

    Greetings,
    Bertus

    PS I will try on.
     
    Last edited: Jun 7, 2009
  10. Peter Pan

    Thread Starter Senior Member

    Mar 24, 2005
    122
    0
    Hi Bertus,

    OpenSuse seems a good Linux package and I have decided to install this because my Linux XP is obsolete already and I need to update it.

    A driver for my device should be there (in OpenSuse) already and perhaps its newest version (presented at FTDI site) is not absolutely necessary (esp if device will work well with driver presented in OpenSuse!)
     
  11. bertus

    Administrator

    Apr 5, 2008
    15,646
    2,345
  12. Peter Pan

    Thread Starter Senior Member

    Mar 24, 2005
    122
    0
    Hi Bertus,

    Thank you for the useful link.
    I have installed OpenSuse 11.1 and this has recognized my UM245R device! Thanks a lot for your help.
     
Loading...