Can't use CyAPI with Borland C++ Builder for a CY7C64713

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

cross mob
Anonymous
Not applicable
        Hello.   
   
I'm a beginner and I want to make a software with Borlan C++ Builder that communicate with a CY7C64713. I have to convert an old soft for an AN3151.   
   
First I wanted to used the same easy way: use a "createfile" (before we could use createfile("////.//ezusb-0",...) ). But the as the new driver don't create a link as "ezusb-0" I want to use the CyAPI library.   
   
As written in the CyAPI.pdf I include CyAPI.h and link CyAPI.lib to my project but the UCHAR type is not declared anywhere. I had the same kind of problems when I wanted to use the cyioctl.h (the headers are not complete and some includes aren't found anywhere).   
   
So I have some questions:   
-Why the virtual link "ezusb-0" isn't created anymore? Can I make it myself (can I rebuild the driver?)   
-Did I make any mistake with CyAPI?   
-Where can I find the include usb200.h and pshpack1.h for the cyioctl.h?   
   
Thank you.   
0 Likes
10 Replies
Anonymous
Not applicable
        look into    http://www.cypress.com/?rID=32538 to find the key differences between cyusb.sys and ezusb.sys... there is a point there about customizable GUID that is how the driver is identified and the application talks to the device through it... The source of ezusb.sys is available through one of DVK (i believe FX1 kit CY3674) in case you are comfortable of working with that.... but i wouldn't recommend that especially since the support for ezusb.sys has been pulled out....   
Are you using the latest software package suiteusb3.4???   
The include files you are talking about i believe are part of the OS... Which version of Borland C++ Builder are you using??? The support for borland C++ is being pulled out.... If possible move to the .Net version of the interface using c#... it has some APIs and more support to make programmers life easier....   
0 Likes
Anonymous
Not applicable
        I'm using Borland C++ Builder 6 with Windows XP professional edition and I can't move to the .net. I have the latest package suiteusb3.4 but I'm not using it as I saw it is designed for Visual Studio.   
   
I want to use cyusb.sys and it seems that I can because there is a Borland library but I can't use it (the "UCHAR" type isn't declared and I don't know where I can find it). I could do something wrong but I don't see what.   
0 Likes
Anonymous
Not applicable
        I've not used borland C++ in the past... These kind of error usually occur when the installation is corrupted... There is an borland project in suiteusb 3.4 called FXEEPROM... check whether that builds for you without errors????   
0 Likes
Anonymous
Not applicable
        I don't see anything called FXEEPROM, for information I took suiteusb3.4 from here:    http://www.cypress.com/?rID=34870 to see if it could help me.   
0 Likes
Anonymous
Not applicable
        That is strange.... C:\Program Files\Cypress\Cypress Suite USB 3.4.1\CyAPI\examples is the path where the FxEEPROM example is located... can you try reinstalling suiteusb3.4....   
0 Likes
Anonymous
Not applicable
        All my apologize I had suiteusb3.4 for visual studio. Indeed the project works fine, the line "#include        " was removed that's why I couldn't build the project. Thank you for your help, I don't know how I get the suiteusb3.4 for VS...   
0 Likes
Anonymous
Not applicable
        Hi Tino,   
I'm doing quite the same as you with the Borland C++ builder, but I couldn't make the FxEEPROM example to work. I also added the CyAPI.h include to the project so the project is compiling successfully, but the generated executable is crashing (EAccessViolation). How did you make it work ?   
0 Likes
Anonymous
Not applicable
        Usually access violations happen when you use structures like endpoints without being connected with the chip. Make sure your handle is right and give me more information about this crash and when does it occure in the code.   
0 Likes
Anonymous
Not applicable
        Tino,   
the crash occurs at the first call to the API:   
FX2Device = new CCyUSBDevice(Handle);   
   
I just received thean answer from the Cypress tech support that confirms my fears: the CyAPI.lib included in the Cypress packages is compiled for Borland C++ builder version 6 and is not compatible with later version of the C++ builder (I use version 10 from Borland Studio 2006).   
Unfortunately I see no way to convert this static library to any another format compatible with recent compilers.   
I also tried to convert the CyAPI.lib for Visual C++ to Borland format without success. You can see the development of my work in this thread:   
    http://www.cypress.com/forums/...id=4563&enterthread=y    
   
I see that you use the version 6 of the C++ builder, so you may not be concerned by this issue - until you change to a newer version of the compiler.   
Maybe you can generate a DLL from the lib with your compiler, the dll should be more portable.   
0 Likes
Anonymous
Not applicable
        Tino,   
   
UCHAR is defined in "wtypes.h" as:   
   
typedef unsigned char UCHAR;   
   
Simply add:   
   
#include &ltwtypes.h>   
   
before your #include "CyAPI.h"   
   
Anyone found a way to use the CyAPI.lib in the latest TurboC++ version? My library also crashes at the instantiation of the CCyUSBDevice class...   
   
Cheers,   
   
Elm   
0 Likes