3 Replies Latest reply on Jun 5, 2018 12:12 PM by jeea_1580276

    Have all source code, but have no idea what to do.

      Well the Engineer who wrote all the code for our product is no longer with us. Since 32 bit windows are but a thing of the past I am stuck trying to figure out how to make our .sys file work in a 64 bit windows machine. I have all the source files for everything, the problem is Im not a coder just a tech. I have the source C code which is what I assume is the file I need to compile for 64 bit. The file is filled with intel hex which I assume is for loading the code into the the ez usb chip.


      What I know. It uses the small eeprom to tell the computer its VID PID, which goes to the inf file to run the .sys file. All these are rewritten for our specific hardware, but closes resembles the examples. Using the Cy7C64613-128 EZ USB FX. I dont have the development board.


      I was wondering if any one could run me through the steps of taking the c code and compiling it into a 64 bit .sys file. I got the inf file working.


      Any help would be appreciated.

        • 1. Re: Have all source code, but have no idea what to do.

          The device firmware need not be changed. The host application and the drivers should be based on our latest drivers (& libraries) which are available for all the current OS (Xp-10)The latest driver provided by Cypress is CyUSB3.sys.  The latest driver can be downloaded from the FX3 SDK download page. I am attaching a pdf file. Please refer to section 8, which mentions "EZ-USB.sys to CyUSB3.sys Migration". Also, please test the firmware with the Cypress provided application in the FX3 SDK (i.e Control center and streamer). Once you have testes these, you can use their source to develop your own host application .

          • 2. Re: Have all source code, but have no idea what to do.

            SO after looking into more I noticed that the source file uses the old ezusbsys.rc and ezusbsys.c along with our .c file


            So I have found the cyusb.rc file in one of the zip source folders but have not found a cyusb.c file. Not sure if I need more than that. Is the cyusb.c a bunch of files needed?


            I have a source file I can edit to add the new .c files, and I have WDK to make the .sys file once I get all the correct files in the folder to make it. I can give more info if needed.

            • 3. Re: Have all source code, but have no idea what to do.

              Sorry its been awhile but I just got time to get back to this. After reading your reply and looking into the code, I have found the IOCTL definitions but I am not sure how to deal with the  indirect equivalent commands. Any help would be appreciated so I have copied the code for you to view. I can see that a few will be easy to change over to cyusb3.sys, but some are not. Also is there any other changes I should be looking into in the host code?

              ' ************************************

              '        IOCTL Definitions

              ' ************************************

              ' Set the base of the IOCTL control codes

              Private Const Ezusb_IOCTL_INDEX = &H800


              ' (DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method)

              ' note: DeviceType for each control code is FILE_DEVICE_UNKNOWN

              '       FILE_DEVICE_UNKNOWN * 2^16 = &H220000

              '       'Access' = FILE_ANY_ACCESS = 0


              Public Const IOCTL_Ezusb_GET_PIPE_INFO = &H220000 + METHOD_BUFFERED + (Ezusb_IOCTL_INDEX + 0) * 4

              Public Const IOCTL_Ezusb_GET_DEVICE_DESCRIPTOR = &H220000 + METHOD_BUFFERED + (Ezusb_IOCTL_INDEX + 1) * 4


              Public Const IOCTL_EZUSB_BULK_READ = &H220000 + METHOD_OUT_DIRECT + (Ezusb_IOCTL_INDEX + 19) * 4

              Public Const IOCTL_EZUSB_BULK_WRITE = &H220000 + METHOD_IN_DIRECT + (Ezusb_IOCTL_INDEX + 20) * 4



              Public Const IOCTL_Ezusb_RESETPIPE = &H220000 + METHOD_IN_DIRECT + (Ezusb_IOCTL_INDEX + 13) * 4

              Public Const IOCTL_Ezusb_ABORTPIPE = &H220000 + METHOD_IN_DIRECT + (Ezusb_IOCTL_INDEX + 15) * 4

              Public Const IOCTL_Ezusb_SETINTERFACE = &H220000 + METHOD_BUFFERED + (Ezusb_IOCTL_INDEX + 16) * 4


              '---- Usage

              'result = DeviceIoControl(hUSB, IOCTL_Ezusb_RESETPIPE, PipeNumber, 0, 0, 0, lBytesReturned, 0)

              'result = DeviceIoControl(hUSB, IOCTL_Ezusb_ABORTPIPE, PipeNumber, 0, 0, 0, lBytesReturned, 0)

              'result = DeviceIoControl(hUSB, IOCTL_Ezusb_SETINTERFACE, tSetInterfaceIn, Len(tSetInterfaceIn), 0, 0, lBytesReturned, 0)


              '#define IOCTL_Ezusb_RESETPIPE  CTL_CODE(FILE_DEVICE_UNKNOWN,  \

              '                                                   Ezusb_IOCTL_INDEX+13,\

              '                                                   METHOD_IN_DIRECT,  \

              '                                                   FILE_ANY_ACCESS)


              '#define IOCTL_Ezusb_ABORTPIPE  CTL_CODE(FILE_DEVICE_UNKNOWN,  \

              '                                                   Ezusb_IOCTL_INDEX+15,\

              '                                                   METHOD_IN_DIRECT,  \

              '                                                   FILE_ANY_ACCESS)



              '                                                   Ezusb_IOCTL_INDEX+16,\

              '                                                   METHOD_BUFFERED,  \

              '                                                   FILE_ANY_ACCESS)