PipeTest & Python


Hi, Jake
Call ReadFromPipeOut or WritetoPipeIn in C++ is fine as third argument buf requires a pointer. I don’t know how to call them in Python without a pointer. Could you give an example here?


Jason, this appears to be an oversight. The Python library is created from the C++ library automatically but certain accomodations need to be made for data pointers such as this. This function got left out. I’ll look into the best way to handle this one and let you know.

Most likely, I will bound the output data size at something like 65536. This will allow Python to preallocate the result structure. If something like this would work for your immediate needs, I could quickly make the change and email you a temporary library. Let me know via email, please.



Hi Jake,

Did you ever create a version of the Python library that can be used to talk to pipes? Where could I get a copy?

I appreciate your help.



I went ahead and wrapped the functions myself. Currently, I can write to the FPGA (pipe status changes ok, data is valid in the FPGA), but every read from any pipe returns 0x255, and does not empty the buffered pipe. I tried reading from every endpoint (in range 0x9F-0xB1), and none of these seem to touch the pipes in my FPGA.

I wrote a simple C++ program, with the same effect.

I used Opal Kellys “pipetest.bit”, in case my Verilog was bad, with same effect - write to pipes is ok, read from pipes always returns 0x255.

I know that I have data in the pipe (status seems fine), I get the right results when running under WinXP (so hardware ok), but I can’t get it to work in Linux.

I tried few different versions of libusb (0.1.10a, 0.1.8, default debian), with same result. I looked at strace, and except for a ton of calls to USBDEVFS_REAPURBNDELAY which return “Resource temporarily unavailable,” everything looks ok.

Did you ever manage to get the pipes to work? What library version did you use? Did you ever see a bug like this?

I’ll appreciate any help.


We have noted several problems with Linux with respect to libusb. Unfortunately, they vary depending on distribution, so these problems are difficult to nail down. The libusb folks are concentrating on the development of their new 1.0 version and have not addressed the issues in libusb with much focus.


Can you recommend a working version though?

All I need to know is that on a linux distriution X, with kernel Y and libusb version Z, Opal Kellys ReadFromPipeOut works fine. If you can’t give me that info, I’ll have to move to windows, but that is very inconvinient for unrelated reasons.


Folks using Gentoo have reported good success at the moment.