Problem with installation driver in Linux

Thread Starter

Peter Pan

Joined Mar 24, 2005
122
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.
 

bertus

Joined Apr 5, 2008
22,087
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
 

Thread Starter

Peter Pan

Joined Mar 24, 2005
122
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
Hi Bertus,

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

bertus

Joined Apr 5, 2008
22,087
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:

Thread Starter

Peter Pan

Joined Mar 24, 2005
122
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
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.
 

bertus

Joined Apr 5, 2008
22,087
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.
 

bertus

Joined Apr 5, 2008
22,087
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:

Thread Starter

Peter Pan

Joined Mar 24, 2005
122
Hi Bertus,

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

bertus

Joined Apr 5, 2008
22,087
Hello Vladimir,

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

Rich (BB code):
bert@PC4800:~> su
Wachtwoord:
PC4800:/home/bert # cd Download/Electronica/Software/FDTI/ftdi_sio/
PC4800:/home/bert/Download/Electronica/Software/FDTI/ftdi_sio # ls
ftdi_sio.c  ftdi_sio.h  Makefile  Rules.make
PC4800:/home/bert/Download/Electronica/Software/FDTI/ftdi_sio # make
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
cc1: error: /lib/modules/2.6.22.19-0.2-default/build/include/linux/modversions.h: Bestand of map bestaat niet
ftdi_sio.c:253:24: error: linux/init.h: Bestand of map bestaat niet
ftdi_sio.c:254:24: error: linux/slab.h: Bestand of map bestaat niet
ftdi_sio.c:256:30: error: linux/tty_driver.h: Bestand of map bestaat niet
ftdi_sio.c:257:28: error: linux/tty_flip.h: Bestand of map bestaat niet
ftdi_sio.c:258:26: error: linux/module.h: Bestand of map bestaat niet
ftdi_sio.c:259:28: error: linux/spinlock.h: Bestand of map bestaat niet
ftdi_sio.c:260:25: error: asm/uaccess.h: Bestand of map bestaat niet
ftdi_sio.c:261:23: error: linux/usb.h: Bestand of map bestaat niet
ftdi_sio.c:263:30: error: linux/usb/serial.h: Bestand of map bestaat niet
ftdi_sio.c:274: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘vendor’
ftdi_sio.c:275: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘product’
ftdi_sio.c:282: error: expected specifier-qualifier-list before ‘__u16’
ftdi_sio.c:312: warning: ‘struct usb_serial’ declared inside parameter list
ftdi_sio.c:312: warning: its scope is only this definition or declaration, which is probably not what you want
ftdi_sio.c:316: warning: ‘struct usb_serial’ declared inside parameter list
ftdi_sio.c:321: warning: initialization from incompatible pointer type
ftdi_sio.c:350: error: array type has incomplete element type
ftdi_sio.c:351: warning: implicit declaration of function ‘USB_DEVICE’
ftdi_sio.c:441: error: field name not in record or union initializer
ftdi_sio.c:441: error: (near initialization for ‘id_table_combined’)
ftdi_sio.c:441: error: ‘kernel_ulong_t’ undeclared here (not in a function)
ftdi_sio.c:443: error: field name not in record or union initializer
ftdi_sio.c:443: error: (near initialization for ‘id_table_combined’)
ftdi_sio.c:578: error: field name not in record or union initializer
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:

Thread Starter

Peter Pan

Joined Mar 24, 2005
122
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!)
 

Thread Starter

Peter Pan

Joined Mar 24, 2005
122
Top