openic

Compile Papilio Loader with Mingw32 problem

Recommended Posts

Hello, Jack.

thanks for your good project for Papilio.

I am working on Windows, and I want to build Papilio Loader

by mingw32.

I install cygwin for the unix-like environment and i686-pc-mingw32 

for the building utils. I don't like cygwin-gcc becase it

depends on cygwin1.dll.

 

 

so come to the source I enter the command on the shell:

./configure --host=i686-pc-mingw32 (May be cygwin and mingw32 also 

are cross-compile?).

Everythings go well except the linking of ftdi2 library.

I found that the configure execute the script of PKG_CHECK_MODULES

but I want to execute the upper branch.

I don't known what is the result of 'test -n "$host_alias"', and 

can anybody tell me what is the build option of cygwin?

That is how to ensure ./configure --build=?? 

 

I have adjust the LIBS varirant to "$LIBS -L. -lftd2xx" and the exe 

generated:

#if test -n "$host_alias" ; then    # I see the terminal that host_alias = i686-pc-mingw32, but.. 

AC_DEFINE([WINDOWS], 1, [Cross-compiling for windows])

LIBS="$LIBS -L. -lftd2xx"

#else

# PKG_CHECK_MODULES([libftdi1], [libftdi >= 0.19],

# [CPPFLAGS=$CPPFLAGS $libftdi1_CFLAGS";

# LIBS="$LIBS $libftdi1_LIBS])

#fi

 

 

You should add CXXFLAGS="-static-libgcc -static-libstdc++" in the 

configure.ac, if not the papilio-prog.exe still need the libgcc 

and libstdc++ dll for mingw32.

 

I have found a project to configure the eeprom of ftdi devices which

is called ftdi-eeprom. I want to add to Papilio Loader.

 

And the FTDI port can be configure to be a fifo, which can be used 

to connect the resource of the FPGA and the pc.Just like the Digilent

Adept or Terasic Control Panel.

 

Share this post


Link to post
Share on other sites

Hello openic,

 

I've always built the windows binaries under linux, the project is setup to create linux binaries and to cross compile to create windows binaries from the linux command line...

 

There have been times that I've compiled under windows and here are the old notes I have, I can't guarantee they will work though:

 

From windows command prompt with mingw:

mingw32-g++ -DWINDOWS *.cpp -o butterfly_prog.exe -L. -lftd2xx -static-libgcc -static-libstdc++

 

Under cygwin with g++:

g++ *.cpp -o butterfly_prog.exe -L. -lftd2xx

 

Jack

Share this post


Link to post
Share on other sites

 

I am working on Windows, and I want to build Papilio Loader
by mingw32.
I install cygwin for the unix-like environment and i686-pc-mingw32 
for the building utils. I don't like cygwin-gcc becase it
depends on cygwin1.dll.
 
 
so come to the source I enter the command on the shell:
./configure --host=i686-pc-mingw32 (May be cygwin and mingw32 also 
are cross-compile?).
Everythings go well except the linking of ftdi2 library.
I found that the configure execute the script of PKG_CHECK_MODULES
but I want to execute the upper branch.
I don't known what is the result of 'test -n "$host_alias"', and 
can anybody tell me what is the build option of cygwin?
That is how to ensure ./configure --build=?? 
 
I have adjust the LIBS varirant to "$LIBS -L. -lftd2xx" and the exe 
generated:
#if test -n "$host_alias" ; then    # I see the terminal that host_alias = i686-pc-mingw32, but.. 
AC_DEFINE([WINDOWS], 1, [Cross-compiling for windows])
LIBS="$LIBS -L. -lftd2xx"
#else
# PKG_CHECK_MODULES([libftdi1], [libftdi >= 0.19],
# [CPPFLAGS=$CPPFLAGS $libftdi1_CFLAGS";
# LIBS="$LIBS $libftdi1_LIBS])
#fi
 
 
You should add CXXFLAGS="-static-libgcc -static-libstdc++" in the 
configure.ac, if not the papilio-prog.exe still need the libgcc 
and libstdc++ dll for mingw32.
 

 

Hi openic,

 

You can compile it directly in msys using a simple gcc make file.  No need for cygwin, autogen, automake, autoconfig, perl, aclocal, etc, etc, etc,, you just compile the individual pieces and then link it together with the ftd2xx lib.

 

I have attached a zip file with everything needed to compile it on msys. 

 

The Make file I use looks like this:

GCC           = g++ -I.DEFINES       =CPPFLAGS      = -g -Wall -O2INCPATH       = LINK          = g++ -staticLFLAGS        = -g -O2LIBS          = -L. -lftd2xxpapilio-prog: butterfly.o jtag.o iobase.o ioftdi.o bitfile.o tools.o devicedb.o progalgspi.o progalgxc3s.o	$(LINK) $^ -o $@ $(LIBS)butterfly.o: butterfly.cpp io_exception.h jtag.h ioftdi.h devicedb.h progalgxc3s.h progalgspi.h bitfile.h	$(GCC) -c $(CPPFLAGS) $(INCPATH) -o butterfly.o butterfly.cpp  bitfile.o: bitfile.cpp bitfile.h	$(GCC) -c $(CPPFLAGS) $(INCPATH) -o bitfile.o bitfile.cppioftdi.o: ioftdi.cpp ioftdi.h io_exception.h	$(GCC) -c $(CPPFLAGS) $(INCPATH) -o ioftdi.o ioftdi.cppjtag.o: jtag.cpp jtag.h	$(GCC) -c $(CPPFLAGS) $(INCPATH) -o jtag.o jtag.cppiobase.o: iobase.cpp iobase.h	$(GCC) -c $(CPPFLAGS) $(INCPATH) -o iobase.o iobase.cppdevicedb.o: devicedb.cpp devicedb.h devlist.h	$(GCC) -c $(CPPFLAGS) $(INCPATH) -o devicedb.o devicedb.cpptools.o: tools.cpp tools.h config.h	$(GCC) -c $(CPPFLAGS) $(INCPATH) -o tools.o tools.cppprogalgxc3s.o: progalgxc3s.cpp progalgxc3s.h	$(GCC) -c $(CPPFLAGS) $(INCPATH) -o progalgxc3s.o progalgxc3s.cppprogalgspi.o: progalgspi.cpp progalgspi.h config.h	$(GCC) -c $(CPPFLAGS) $(INCPATH) -o progalgspi.o progalgspi.cppclean:	rm -rf *.o *.exe

As for configuring the FTDI eeprom, you can also use FT_PROG which is the eeprom management program from FTDI.

 

The FIFO mode is pretty cool but not available on Papilio-One or Papilio-Pro boards since the wires needed for that is not connected from the FTDI chip to the FPGA, only serial RX and TX wires are are hooked up.

 

Magnus

papilio-prog-win.zip

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now