Failing with Streamer + USBBulkSourceSink error 997

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

This forum text editor is quite broken in Chrome on my machine, by the way.

   

I uploaded the USBBulkSourceSink firmware to my FX3 dev board. I then ran the C# streamer example, selecting the 0x81 IN endpoint. No matter what combination of other settings in the other comboboxes, after a few seconds it kicks into an error state where every transaction fails. At this point you have to reset the device before any transactions will succeed again (restarting streamer has no effect). As it turns out, LastError was set to 997.

   

I made a much simpler client application without any Overlapped I/O (just using the XferData method), and I ran into the same thing -- it runs for awhile, and then no XferData calls succeed, and LastError is 997. You will remain in this state even if you re-run your client application, you have to reset the device to clear it.

   

Plus, if you specify a transfer size that isn't a power of two (I used 4097), it will stop immediately without reading any bytes with error 997.

   

I am on 64-bit Windows 7 on an 8 core machine.

   

My code is as follows, but it's readily reproducible with the streamer example:

   

static void Main(string[] args)
{
    var usbDevices = new USBDeviceList(CyConst.DEVICES_CYUSB);
    var myDevice = usbDevices[0x04B4, 0x00F1] as CyUSBDevice;

   

    if (myDevice == null)
    {
        System.Console.WriteLine("No device. Try again when you have one.");
        return;
    }

   

    var endpoint = myDevice.EndPointOf(0x81);
    var data = new byte[(args.Length > 0) ? int.Parse(args[1]) : DefaultBufferSize];
    ulong totalBytesRead = 0;
    var stopwatch = new Stopwatch();

   

    System.Console.WriteLine("Using buffer size of {0}", NumberBytesToString((ulong) data.Length));
    System.Console.WriteLine("Timeout is {0}", endpoint.TimeOut);
    stopwatch.Start();

   

    while (true)
    {
        int numberBytesRead = data.Length;
        if (!endpoint.XferData(ref data, ref numberBytesRead))
        {
            if (endpoint.LastError != 0)
            {
                throw new Win32Exception((int) endpoint.LastError);
            }
            else
            {
                throw new Exception("Unknown XferData error");
            }
        }
        if (numberBytesRead < data.Length)
        {
            System.Console.WriteLine("Short read of {0}", numberBytesRead);
        }
        totalBytesRead += (ulong) numberBytesRead;
        System.Console.Write("\r{0}/s", NumberBytesToString(((totalBytesRead * 1000) / (ulong)stopwatch.ElapsedMilliseconds)));
    }
}

   

My ultimate goal is to marshal data through the GPIF through a bulk IN endpoint, and I was starting with this example code as a baseline. But as far as I can tell, either a) the firmware is busted, or b) the C# client library is.

   

Is the streamer example supposed to work better with a different firmware? I just care about IN data, I don't want to loop data OUT and back IN, I just want the FX3 to send data as fast as possible, and then process it as fast as possible on the PC side. Is there an example firmware and client app that can do this?

   

Thanks in advance.

0 Likes
7 Replies
Anonymous
Not applicable

Please create a tech support case so that one of our engineer will reproduce this at our end and help you in running the demo.

   

Thanks,

   

sai krishna.

0 Likes
Anonymous
Not applicable

 I created MyCase 1820608142 and created five examples that use the CyAPI C++ interface, going all the way down to the IOCTL level, all of which fail in my environment. Unfortunately no one has offered any guidance yet as to what to investigate, whether this is a firmware / driver issue, whether this works on 32-bit Windows and it's 64-bit Windows specific, etc.

0 Likes
Anonymous
Not applicable

Hi Blake,

   

I sent a message to tech support team today regarding your case. You will be getting a response soon.

   

Thanks,

   

sai krishna.

0 Likes
Anonymous
Not applicable

 Thanks, that helped -- I got an email saying that they've routed my case to someone.

0 Likes
Anonymous
Not applicable

 Has a solution been found?  I am seeing something similar on my 64bit Windows 7.

0 Likes
ManaskantD_51
Employee
Employee
Welcome! 25 solutions authored 10 solutions authored

 Hi,

   

Are you able to reproduce the same issue with C++ streamer application as well?

0 Likes
Anonymous
Not applicable

 Did you ever solve this?  We are seeing this as well on Win 7. Your help would be very appreciated. 

0 Likes