Anonymous
Not applicable
Jul 20, 2009
12:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 20, 2009
12:12 PM
We are using a CY7C68013A USB controller in a couple of our product. The PC software currently is using a third party driver solution and we would like to convert to using the Cypress Suite USB 3.4.1 libraries. The application currently is written in C++ so the first go at it I was trying to use the CYAPI.lib. It compiles fine, but if there is a (Cypress) device (with our VID,PID) connected to the USB port, the statement:
USBDevice = new CCyUSBDevice(NULL);
throws an exception. If no device is connected, it does not throw the exception.
I then decided to try a C# solution, and started with the Control Center example. Again, if a device is connected the following statement:
usbDevices = new USBDeviceList(DeviceMask);
will generate 8-10 messages in the output window:
A first chance exception of type 'System.ArgumentNullException' occurred in mscorlib.dll
If no device is connected, no exceptions.
I am not sure where to look next, any suggestions.
Thanks,
Bjarne
USBDevice = new CCyUSBDevice(NULL);
throws an exception. If no device is connected, it does not throw the exception.
I then decided to try a C# solution, and started with the Control Center example. Again, if a device is connected the following statement:
usbDevices = new USBDeviceList(DeviceMask);
will generate 8-10 messages in the output window:
A first chance exception of type 'System.ArgumentNullException' occurred in mscorlib.dll
If no device is connected, no exceptions.
I am not sure where to look next, any suggestions.
Thanks,
Bjarne
8 Replies
Anonymous
Not applicable
Jul 21, 2009
03:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 21, 2009
03:17 AM
you are supplying NULL instead of supplying the handle name... I believe that is the reason behind the error here... Can you upload your entire code here...
Anonymous
Not applicable
Jul 21, 2009
11:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 21, 2009
11:57 AM
Thank you for the reply aasi.
For some reason I don't get the exception in the C++ statement anymore, and I am not sure what I changed The help file says that supplying NULL for the handle is OK, if you don't want PnP notification, and it seems to work with NULL or a handle now. (The code is presently hacks into my old code, so it would not make much sense to post it).
Moving on, I am now trying to figure out how to implement the PnP callbacks, it sure would be nice if there was a C++ example somewhere.
Do you know why I might get the exceptions in the (unmodified) Control Center C# example? I do eventually want to move to managed code.
Anonymous
Not applicable
Jul 21, 2009
10:37 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 21, 2009
10:37 PM
If you have installed suiteusb3.4 You can find C++ examples in C:\Program Files\Cypress\Cypress Suite USB 3.4.1\CyAPI\examples... I think screamer example should be implementing PnP callbacks...
I'm not sure why unmodified control center code is not compiling... i remember being able to compile it properly... What error are you seeing when you try to compile it...
I'm not sure why unmodified control center code is not compiling... i remember being able to compile it properly... What error are you seeing when you try to compile it...
Anonymous
Not applicable
Jul 22, 2009
11:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 22, 2009
11:01 AM
Thank you, I was only looking in the examples directory at the top level, I should have dug further down.
On the C# Control Center 'problem', it is a runtime exception, not a compile error, I get when executing the following statement in debug mode:
usbDevices = new USBDeviceList(DeviceMask);
will generate 8-10 messages in the output window:
A first chance exception of type 'System.ArgumentNullException' occurred in mscorlib.dll
If no device is connected, no exceptions.
On the C# Control Center 'problem', it is a runtime exception, not a compile error, I get when executing the following statement in debug mode:
usbDevices = new USBDeviceList(DeviceMask);
will generate 8-10 messages in the output window:
A first chance exception of type 'System.ArgumentNullException' occurred in mscorlib.dll
If no device is connected, no exceptions.
Anonymous
Not applicable
Jul 24, 2009
02:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 24, 2009
02:04 AM
Dude, I tried replicating the issue at my end... it works fine for me... does your device belong to a specific class or is it generic usb... What is the length of your descriptor table...
Anonymous
Not applicable
Jul 24, 2009
05:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 24, 2009
05:43 PM
Interesting, did you run the application in debug mode, and you did not see this message in the Visual Studio output window?
The application works, but I am always concerned when I see exceptions being thrown, and I was asking why this might be.
The application works, but I am always concerned when I see exceptions being thrown, and I was asking why this might be.
Anonymous
Not applicable
Jul 24, 2009
10:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 24, 2009
10:43 PM
I didn't see these exceptions... i was running bulkloop example on my board connected to cyusb.sys and i didn't see these errors... since you are talking about using a third party driver earlier i was thinking it might have something to do with the descriptor of the device because if there is discrepancy in the descriptor the console is bound to throw exceptions....
Anonymous
Not applicable
Jul 25, 2009
10:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 25, 2009
10:46 AM
OK, thanks.