Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Failing with Streamer + USBBulkSourceSink error 997

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Failing with Streamer + USBBulkSourceSink error 997
Moderator:
RSKV

Post Reply
Follow this topic



Failing with Streamer + USBBulkSourceSink error 997

blake182 posted on 06 Oct 2012 11:34 PM PST
Member
4 Forum Posts

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.




Re: Failing with Streamer + USBBulkSourceSink error 997

RSKV posted on 09 Oct 2012 09:58 AM PST
Cypress Employee
655 Forum Posts

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.



Re: Failing with Streamer + USBBulkSourceSink error 997

blake182 posted on 11 Oct 2012 10:38 AM PST
Member
4 Forum Posts

 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.



Re: Failing with Streamer + USBBulkSourceSink error 997

RSKV posted on 12 Oct 2012 01:12 AM PST
Cypress Employee
655 Forum Posts

Hi Blake,

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

Thanks,

sai krishna.



Re: Failing with Streamer + USBBulkSourceSink error 997

blake182 posted on 12 Oct 2012 11:08 AM PST
Member
4 Forum Posts

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



Re: Failing with Streamer + USBBulkSourceSink error 997

cgooi posted on 08 Feb 2013 09:43 AM PST

1 Forum Post

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



Re: Failing with Streamer + USBBulkSourceSink error 997

Manas posted on 11 Feb 2013 11:02 PM PST
Cypress Employee
3 Forum Posts

 Hi,

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






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.