New IT forum Follow us on Twitter
23 May 2012, 03:40:35 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: EFIKA MX now in stock!
 
   Home   SHOP Help Search Login Register  
Pages: [1]
  Print  
Author Topic: ftdi driver  (Read 2299 times)
hotwater
Newbie
*
Posts: 4


WWW
« 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:
# 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


« 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


WWW
« Reply #2 on: 23 September 2010, 05:37:32 pm »

me too.....  Grin

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

I need compile this code:
Code:
/*
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]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!