Has anyone had trouble with USB transfers of 512 bytes or less?
The first time we do this, it works fine. Following this, though, we’re unable to download a new FPGA bitfile until we disconnect the USB power and then reapply it.
We’re using a xem3001v2 and Linux. We’ve tried buffered and unbuffered PipeIns, but have had the problem with both. Any help greatly appreciated!
We have an in-house application that transfers small packets (2-128 bytes typically) repeatedly without any problems. This application works on both Linux and Windows.
What firmware and FrontPanel versions are you using?
A buffered pipe is just a regular pipe with an adjoined FIFO, so the presentation to the host interface is identical.
That’s encouraging news! Are you able to reconfigure too?
Here’s the information written back by the board:
Board model 2
Device list model 2
Device list serial cSBBQqLCUg
Device major version 2
Device minor version 3
Device serial number cSBBQqLCUg
Device ID Opal Kelly XEM3001
We’re using FrontPanelFC3-v1.3.1, which we downloaded from the website. We’re mainly using CPP, although we have tried Python too, with the same results.
I’ve attached some CPP which we’ve been using to try to track down the problem - the VHDL we use is very simple, it just counts the words it receives and adds them up to make a checksum.
I know it sounds like a cop-out, but have you tried another machine. We’ve had pretty poor consistency among Linux machines and USB support. And not just with our device.
On our end, we have seen the same sort of problem with both a Debian Etch and Sid system and it does not occur on any windows machine I have tried. This was seen with both the 3001v2 and the 3010 and using different bitfiles from Tim.
I’m reasonably sure it has something to do with the linux drivers and not the board. It’s not that the board needs to be powered down but the usb interface needs to be remounted, which is why reloading ehci_hcd fixes the problem. Of course in practice this is not a solution because you need root access and it will affect all USB devices.
You never said if you have tried to run Tim’s test code, and whether you see the same results. I’m curious what system, and more importantly, what version of libusb you are running if it works without problems.
We’ll look into this shortly and get back to you. As you know, our Linux port is currently based on libusb. We’re looking into moving past that dependency and writing a straight IOCTL implementation.
I tried this on our Linux machine here (FC3) and it works fine. In fact, our regression tests include tests for short pipe transfers, but I wanted to make sure your code worked verbatim.
The machine is an unmodified FC3 installation.
Your .h file should be revision 235. Your .a files should be 112,652 bytes. Are these the same as yours?
The version numbers are the same. We have not updated the FC3 installation, so it should be a clean, stock FC3 install with all the original stuff in there.
Perhaps this is a driver issue with the particular USB controller on your motherboard conflicting somehow with libusb. ?
Perhaps this is a driver issue with the particular USB controller on your motherboard conflicting somehow with libusb. ?
— End quote
This is unlikely seeing we have seen this problem on at least of 3 different machines each with different chipsets and drivers.
This may be a stupid point but it looks like the Main.cpp file that Tim attached is setup to write 514 bytes, which is supposed to work. Did you change this when you tried running the code?
The only other thought I have is a problem with the bit files we are using. Maybe Tim could attach the one he is using and you guys could try it with that?