Winelib

proof of concept for USB DLL driver with ftd2xx.dll lib

A lot of Windows programs can be used on Linux with WINE.  Access to the simple USB peripheral devices like serial IO using COM ports is no problem. Not running with WINE are programs using special DLL's for USB  from different chip manufacturers.

 FTDI provide binary drivers and libraries for Windows and Linux. For fast access the use of FTD2XX driver and dll is recommended on both systems.  With this knowledge it is possible to build a WINELIB for ftd2xx.dll so WINE can access this USB devices.


Here I show for programs using FTD2XX.DLL how to run Windows programs with WINE on Linux. The secret behind is winelib. By default WINE include a lot of Microsoft DLL's using winlibs, but all these do not support USB date transfers.

Now here is a winelib to communicate with FTDI chips when the Windows program use FTDI2XX.dll for IO.

As this is a proof of concept the same method should work for other Windows programs using DLL's.
With some work for asyncron USB transfers this can also be done for libusb-win32 as well.

Please have a look to the
Readme file I also packed to the binary how to install.

First tests for working can be done with the FTDI program MPROG.EXE to read out the eeprom table form FTDI USB chips.

When installed the FTDI library libftd2xx.so.0  and copied FTD2XX.dll to linux  to build  I run

winedump spec  -I /usr/local/lib/libftd2xx0.4.16/ftd2xx.h FTD2XX.dll

then I populated the build FTD2XX_main.c and continue

winegcc -D_REENTRANT -D__WINESRC__  -lftd2xx -c FTD2XX_main.c
winegcc  -mwindows -lntdll -lkernel32 -lftd2xx -o ftd2xx.dll.so FTD2XX_main.o -shared FTD2XX.spec
winebuild -w --def -o libftd2xx.def --export FTD2XX.spec