New IT forum
26 June 2022, 06:13:00 pm *
Welcome, %1$s. Please login or register.

: PiHub now in stock.
 
Pages: [1]

Author Topic: ftdi driver  (Read 9483 times)

hotwater

  • Newbie
  • *
  • Posts: 4
    • my blog
ftdi driver
« on: 22 September 2010, 05:33:07 pm »

I need FTDCHIP library in order to compile a soft.
I download the driver on http://www.ftdichip.com/Drivers/D2XX.htm

but i have an error with compilation:
Code: [Select]
# gcc -o bitmode -L. -lftd2xx -Wl,-rpath /usr/local/lib main.c
/usr/bin/ld: skipping incompatible /usr/lib/gcc/arm-linux-gnueabi/4.3.3/../../../libftd2xx.so when searching for -lftd2xx
/usr/bin/ld: skipping incompatible /usr/local/lib/libftd2xx.so when searching for -lftd2xx
/usr/bin/ld: skipping incompatible /usr/lib/libftd2xx.so when searching for -lftd2xx
/usr/bin/ld: cannot find -lftd2xx
collect2: ld returned 1 exit status
make: *** [bitmode] Error 1

thanks
Logged

peter a

  • Full Member
  • ***
  • Posts: 162
Re: ftdi driver
« Reply #1 on: 23 September 2010, 06:22:50 am »

I just used one of these kernels, which have ftdi already installed :-

http://sheeva.with-linux.com/sheeva/
Logged

hotwater

  • Newbie
  • *
  • Posts: 4
    • my blog
Re: ftdi driver
« Reply #2 on: 23 September 2010, 05:37:32 pm »

me too.....  ;D

but with ftdi of Sheeva's kernel,you can't make a compilation of "ftdchip" soft, because i need ftd2xx.h and libftd2xx.so  :'(

I need compile this code:
Code: [Select]
/*
To build use the following gcc statement
(assuming you have the d2xx library in the /usr/local/lib directory).
gcc -o bitmode main.c -L. -lftd2xx -Wl,-rpath /usr/local/lib
*/

#include <stdio.h>
#include "../ftd2xx.h"

int main(int argc, char *argv[])
{
DWORD dwBytesInQueue = 0;
FT_STATUS ftStatus;
FT_HANDLE ftHandle;
unsigned char ucMode = 0x00;
int iport;

if(argc > 1) {
sscanf(argv[1], "%d", &iport);
}
else {
iport = 0;
}

ftStatus = FT_Open(iport, &ftHandle);
if(ftStatus != FT_OK) {
/*
This can fail if the ftdi_sio driver is loaded
use lsmod to check this and rmmod ftdi_sio to remove
also rmmod usbserial
*/
printf("FT_Open(%d) failed\n", iport);
return 1;
}

ftStatus = FT_SetBitMode(ftHandle, 0xFF, 1);
if(ftStatus != FT_OK) {
printf("Failed to set bit mode\n");
}
FT_SetBaudRate(ftHandle, 9600);

FT_Write(ftHandle, &ucMode, 1, &dwBytesInQueue);

ftStatus = FT_GetBitMode(ftHandle, &ucMode);
if(ftStatus != FT_OK) {
printf("Failed to get bit mode\n");
}
else {
printf("ucMode = 0x%X\n", ucMode);
}

FT_Close(ftHandle);

return 0;
}


Logged
Pages: [1]
 
 

Powered by MySQL Powered by PHP SMF 2.0.10 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!