quicky

Using PapilioLoader on Papilio DUo

Recommended Posts

Hi Jack,

 

At this time I still not have Design Lab installed on Linux

I would like to load an FPGA design on Papilio Duo using Papilio Loader ( Gui or command line ) but I don`t see the FTDI in lsusb result. FOr my PapilioOne board i`m able to load the bistream.

Is it mandatory to install DesignLab to load the bistream on FPGA of Papilio DUO?

 

Thanks by advance

Share this post


Link to post
Share on other sites

Ok, 

 

I just made a new 2.7 release of the Papilio Loader to support Papilio DUO and other improvements:

http://forum.gadgetfactory.net/index.php?/files/file/10-papilio-loader-gui/

 

2/24/2015 Version 2.7
Papilio GUI
-Add Board Name field so you can manually specify the board name.
-Added Papilio Pro, Papilio One, and Papilio DUO to Target Board dropdown.
-Removed .bmm and .hex fields from simple mode.
-Updated Icon
-Drivers are signed for easy install in Windows 8
 
papilio-prog
-Support for the Papilio DUO VID/PID

Share this post


Link to post
Share on other sites

I'm having trouble talking to the Papilio DUO FT2232H on Ubuntu 12.04 using libftdi.so.  I have no trouble with Papilio One (vendor ID 0403, product 6010), a generic FT2232H board (also 0403/6010) or an Adafruit FT232H board (0403/6014).  However, the 0403/7BC0 for the Papilio DUO gives me the libftdi error "inappropriate permissions on device!"

 

Here's my /etc/udev/rules.d/85-ftdi.rules:

 

#FTDI rules
ATTR{idVendor}=="0403", ATTR{idProduct}=="6010", MODE="660", GROUP="ftdi-user"
ATTR{idVendor}=="0403", ATTR{idProduct}=="6014", MODE="660", GROUP="ftdi-user"
ATTR{idVendor}=="0403", ATTR{idProduct}=="7BC0", MODE="660", GROUP="ftdi-user"

 

Any suggestions would be appreciated!

Share this post


Link to post
Share on other sites

Here is the sh file I use with DesignLab:

#!/bin/bashusername=`whoami`if [ $username != "root" ]; then	echo "You must run this using sudo."	exit 1fiecho $SUDO_USERusermod -a -G dialout $SUDO_USERapt-get install libftdi-dev gawkchgrp dialout hardware/tools/papilio/papilio_loader/papilio-progchgrp dialout tools/Papilio_Loader/programmer/linux32/papilio-progecho 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", GROUP="dialout"' > /etc/udev/rules.d/papilio.rulesecho 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="7bc0", GROUP="dialout"' >> /etc/udev/rules.d/papilio.rulesecho 'ACTION=="add", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="7bc0", RUN+="/sbin/modprobe ftdi_sio" RUN+="/bin/sh -c '"'"'echo 0403 7bc0 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id'"'"'"' >> /etc/udev/rules.d/papilio.rulesudevadm control --reloadecho "You may need to log out and back in for the changes to take affect, if that does not work then reboot."su $SUDO_USER

Maybe you need to add your user to the dialout group?

 

Jack.

Share this post


Link to post
Share on other sites

Thank you both for the quick and helpful replies.

 

If I plug in my Papilio One I see /dev/ttyUSB0 and /dev/ttyUSB1.

If I plug in my Papilio DUO I don't see any /dev/USB*.

 

As I understand libftdi, it disconnects the serial port and replaces it with direct access to FT2232 commands.  So if there's no serial port it gets confused.

 

Jack's script should set things straight by adding "modprobe" to /etc/udev/rules.d/papilio.rules.  I'm having a little trouble mentally parsing the script.  Jack, could you please show me what papilio.rules looks like after the changes?  I generally like to make rule changes manually so I have a better idea what I'm doing, and so I can try to explain it to others.  Thanks!

Share this post


Link to post
Share on other sites

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", GROUP="dialout"

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="7bc0", GROUP="dialout"

ACTION=="add", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="7bc0", RUN+="/sbin/modprobe ftdi_sio" RUN+="/bin/sh -c 'echo 0403 7bc0 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id'"

Share this post


Link to post
Share on other sites
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", GROUP="dialout"SUBSYSTEMS=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="7bc0", GROUP="dialout"ACTION=="add", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="7bc0", RUN+="/sbin/modprobe ftdi_sio" RUN+="/bin/sh -c 'echo 0403 7bc0 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id'"

Thanks, Jack!  I'll try it out.

Share this post


Link to post
Share on other sites

Thanks, Jack!  I'll try it out.

I'm starting to get there.  With the changes to /etc/udev/rules.d I'm now seeing /dev/ttyUSB0 and /dev/ttyUSB1.  However, I'm still not able to connect to the FTDI chip as a normal user, even though I'm in both the dialout and ftdi-user groups.

 

I am able to connect to Papilio DUO as superuser, and the FPGA works great so far.

 

I'm going to see if there's another way to get permission.  I think the vendorID:productID combinations are listed in /lib/modules/<kernel number>/modules.alias, so maybe I can just add v0403p7BC0 to that file.  However, I don't want to mess until I have a better idea what I'm doing.  Maybe there's a better place to add extra lines for modules.alias.

 

Thank you again for your help, Jack.

 

(My latest experiments were with an ODROID-C1 running Ubuntu 14.04.  Maybe it will work better on a PC with Ubuntu 12.04)

Share this post


Link to post
Share on other sites

I'm starting to get there.  With the changes to /etc/udev/rules.d I'm now seeing /dev/ttyUSB0 and /dev/ttyUSB1.  However, I'm still not able to connect to the FTDI chip as a normal user, even though I'm in both the dialout and ftdi-user groups.

 

(My latest experiments were with an ODROID-C1 running Ubuntu 14.04.  Maybe it will work better on a PC with Ubuntu 12.04)

Got it working on my ODROID-C1 running Ubuntu 14.04.  So now I can download Papilio DUO images as a normal user from my own programs using libftdi.so.

 

I made some slight changes to the ACTION:

 

ACTION=="add", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="7bc0", \
  RUN+="/sbin/modprobe ftdi_sio", \
  RUN+="/bin/sh -c 'echo 0403 7bc0 > /sys/bus/usb-serial/drivers/ftdi_sio/new_id'"
 
I put in backslashes so I could split the long line into something easier to edit and I added a comma after the first RUN.  I don't know if it's necessary or not.
 
I've found that ODROID-C1 Ubuntu 14.04 puts /dev/ttyUSB0 and 1 into group "dialout" even if the udev rule tries to assign to a different GROUP.  I'm going to try this on a PC running Ubuntu 12.04 and see if it behaves differently.

Share this post


Link to post
Share on other sites

Welcome to systemd/udev :P

 

I personally have that in a simple shell script, and run it only when I reboot (which should be about 4 times/yr if I don't have to undergo some kernel updates).

 

udev rules can be complex. Some other rule may be overriding your permissions.

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