Hans

Papilio loader and multiple FTDI based devices

Recommended Posts

Hi,

 

I am trying to use the Papilio loader and an Intronix Logicport logic analyzer using Windows 7 at the same time.  Trouble is that both the Papilio Pro and the logic analyzer use the FTDI serial chip, and the loader program mistakenly tries to talk to the logic analyzer instead of the FPGA board (and fails).  The logic analyzer software does not have the same trouble, it detects its device and works.  Is there any known workaround to make the Papilio loader talk to a specific USB device instead of using the vendor and device ID?

 

Thanks,

Hans

Share this post


Link to post
Share on other sites

Hello,

 

Yes, I also find this is a minor, but annoying problem.  For a long while I thought I had "killed" my Papilio (because I almost always have a FTDI serial hooked up).

 

I have over a half dozen little do-dads that use FTDI (several from Gadget Factory) and have to remove all of them before Papilio Loader will work reliably (and also same issue with fpgaprog-win for Pipestrello, on which I believe the Papilio loader is based).

 

I have tried a few command line options, but I haven't had success in getting it to look at a specific COM port (which would still not ideal, as those are "moving targets"), so I would be interested in any workarounds.

 

I wonder if it would be possible to get the "Device name" or something (as these are usually unique)?  However, just having the UI ask the user when multiple FTDI devices are present would be useful (especially if it defaulted to the answer from "last time").

 

-Xark

Share this post


Link to post
Share on other sites

It looks like the feature needs to be added to papilio-prog/butterfly.cpp. If you want a hacky fix, you could try hard coding your ftdi serial number:

 

 

    char const *serial = "whateveryourserialnumberis";
instead of

 

    char const *serial = 0;
 
This is something that would be useful for me so I may modify the code to accept serial numbers on the command line if I have time soon. Bear in mind though I'm tired and all of this may be wrong.

Share this post


Link to post
Share on other sites

I too have had this annoyance for quite one time and it continues to grow as I collect more FTDI-based USB devices. It would be great if we could one up with a solution.

Share this post


Link to post
Share on other sites

It seems that the current papilio-prog source has code to select a particular device by description (-d), but that does not work for me on Windows (the FT_OpenEx call never succeeds when I specify a device description sting).  On Linux it does work, so it seems to be an issue of the FTDI library that is distributed with the code for Windows, but I'm not a Windows programming expert.  Any further pointers would be appreciated.

Share this post


Link to post
Share on other sites

There are two issues here:

1)  The device name used with the -d option on dual-channel devices like FT2232D must include the channel (A or B).  Say the device name is "Papilio Pro" then the -d option is looks like this: -d "Papilio Pro A".

 

2) To complicate things even more, the generic FTDI device name is "USB <-> Serial Cable" but windows command line shell will interpret the < and > characters as special.  See http://stackoverflow.com/questions/251557/escape-angle-brackets-in-a-windows-command-prompt

 

One option is to use the FTDI utility program FT_PROG to change the device name so something without < or >, like "Papilio Pro" and then specify the device using the -d option like mentoined above.  Or you could use msys with bash for a unix-style command-line shell.

 

Hope this helps.

Share this post


Link to post
Share on other sites

Thank you for the explanation!  With these instructions, I was able to run my logic analyzer and the Papilio Pro board at the same time, which really improves my productivity.

Share this post


Link to post
Share on other sites

There are two issues here:

1)  The device name used with the -d option on dual-channel devices like FT2232D must include the channel (A or B).  Say the device name is "Papilio Pro" then the -d option is looks like this: -d "Papilio Pro A".

 

2) To complicate things even more, the generic FTDI device name is "USB <-> Serial Cable" but windows command line shell will interpret the < and > characters as special.  See http://stackoverflow.com/questions/251557/escape-angle-brackets-in-a-windows-command-prompt

 

One option is to use the FTDI utility program FT_PROG to change the device name so something without < or >, like "Papilio Pro" and then specify the device using the -d option like mentoined above.  Or you could use msys with bash for a unix-style command-line shell.

The problem mentioned in the stack overflow question arises purely due to echo being a special command in the windows shell rather than a program thus it will echo the quotes when you use them to escape the < and > since papilio-prog is in fact an executable it should be quite possible to pass the programmer "USB <-> Serial Cable A" and the shell wont try and do anything with the <> chars and papilio prog should receive the device name without quotes as an argument. Of course changing the device name on the papilio will allow for easier recognition and prevent problems with there being more than one with the default name.

Share this post


Link to post
Share on other sites

Yeah, the windows echo thing might be different but in any case the -d option with the default FTDI name "USB <-> Serial Cable" will not work for whatever reason but changing the device name to something like "Papilo Pro" makes it work.  My assumption is that the < and > characters are causing the problem.

Share this post


Link to post
Share on other sites

OK, this problem really bugged me so I tracked it down.  The problem is that the Papilio board is shipped with a blank EEPROM.  The EEPROM normally contains the device name but if the EEPROM is blank the FTDI driver must come up with a default name.  The problem is that the tool FT_PROG is reporting the device name for a board with a blank EEPROM as "USB <-> Serial Cable" but that's not what the ftd2xx driver thinks the name is.  By writing some code for ftd2xx that reports back the information on all connected ftdi devices the result was that the ftd2xx driver thinks the device name of a board with a blank EEPROM is "Dual RS232"

 

So if you want to use the -d option on a "virgin" Papilio board with a blank EEPROM it should look something like this:

papilio-prog -v -j -d "Dual RS232 A"

Share this post


Link to post
Share on other sites

I suppose we need to write the board identity (model, version etc) in the EEPROM that we have been shipping blank for so long. Its no longer just the FPGA model, we also have a few variants that use the same setup : FT2232+same FPGA. It will be helpful for our next update for the Papilio Loader app that can identify the boards and resolve between multiple FTDI instances, and employ board and core specific programming methods.

 

Fortunately the FTDI provides utility FT_prog is freely downloadable and saves the EEPROM data in a file, so updating the boards that have already been sold should not be an issue, we can make the EEPROM files available for download.

Share this post


Link to post
Share on other sites

Yes, that's what the eeprom is for.  FYI, every Pipistello board shipped so far has a unique serial number, correct driver settings (ftd2xx for port A and VCP for port B ) and a product-specific name (Pipistrello-LX45) programmed in the eeprom.

Share this post


Link to post
Share on other sites

My Papilio Pro appears to have shipped with a blank EEPROM.  And its trying to program the Wrong FTDI chip.  I cant seem to locate the correct ROM file on the site.   Is there a file for this or are at least the correct descriptors so I can program the FTDI correctly.

Share this post


Link to post
Share on other sites

Download the template attached to this post and save it as an XML extension file. Download FT_PROG 2.8.2.0 - EEPROM Programming Utility then run it with your FPGA board attached. Scan the bus (magnifying glass icon) and locate in the tree the one with the blank eeprom. Then right click on it and choose apply template from file and browse to where you save this template. Program the board (lightining icon).

 

Before programming (or even after) and if you know what you're doing, you can go through the various options and change to suit you. For example if you don't like the name I picked you can make your own, you can choose to generate a serial number, etc.

 

Until Jack provides an official template, feel free to use this,

Papilio_Pro.txt

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