2 Replies Latest reply on Feb 8, 2017 6:09 AM by david.bubble

    Linux Api CyOpen not working under CDC Mode for CY7C65211

    david.bubble

      Hi all,

         

      I've install the SO library into my raspberry pi and device able to detect after i plug it in to usb port. However when i try to turn on one of the GPIO pin, my C code at CyOpen step return CY_ERROR_DRIVER_OPEN_FAILED status. I checked my device with config tool in window and found out the CY7C65211 is using CDC mode. If i change it to VENDOR then my C code runs fine without error.

         

      So the question is, CY7C65211 CyOpen will fail if it is using CDC mode in linux? I tried my program on window CyOpen works for both CDC and VENDOR mode. Please advice how do i make this work in linux.

         

      Thanks.

         

      Regards.

        • 1. Re: Linux Api CyOpen not working under CDC Mode for CY7C65211
          nisa

          Please attach your both application. We will try it here and tell you more.  Please share the Windows and Linux application (aslo please mention the steps to build it on Linux)

          • 2. Re: Linux Api CyOpen not working under CDC Mode for CY7C65211
            david.bubble

            Here is the test code i used to test CyOpen command. Please refer to attached.

               

            Hi Nishant,

               


            Thanks for the reply. Here are the steps that i done to get to where i am now:
            1. Installed raspbian jessie lite (2016-09-23 release) to my raspberry pi 3. Installed "gfortran" from apt.

               

            2. I downloaded the linux SDK from software SDK page under Linux (Somehow i'm not allow to link it here). I followed the Readme instruction in build the required package.

               

            3. First i build and install libusb 1.0.9. Unzipped the tar file and cd into the directory.

               

            4. I followed the build instruction from linuxfromscratchpage (Again I'm not allow to link it here) for libusb. First run "/configure --prefix=/usr --disable-static" without the quote. After complete i run "sudo make" and finally "sudo make install" to install the package. No error msg observed.

               

            5. Next install the SO file per instruction. I cd into the /linux/library directory and run "sudo make". I saw a the SO file created in my system directory as mentioned in readme file. No error msg observed as well.

               

            6. Finally I cd into the /linux/testUtility directory and run "sudo make". I tried to run test utility using CyUSBSerialTestUtility command and it run properly. When i plug in a device programmed using vendor mode. I can see the device by typing 1 in the utility. However, I'm not able to list the device by typing 1 if the device is programmed using CDC mode. So i suspect something is wrong here.

               

            7. I wrote a test program in C code and compile in raspbian. Please refer to attached for the C code. (testcode.zip)

               

            8. Please compile the code using command below "gcc -o testcode testcode.cc -L/usr/local/lib -lcyusbserial" without the quotes to build the program.

               

            9. Run the program with "./testcode". You should see an message "Init success" and "Open Success" once the program complete running. This program simply try to CyOpen the device and print out the status code return from device. If you try to program the device with vendor mode and run the program. It should run with success status. Else if you try to program the device with CDC mode, run the program and you should see the "CyDriverOpenFailed" message.

               

            Please help to test it out at your side and see if you can replicate the same error. Thank you.

               

             

               

            Edit: I add in the readme file from the SDK to attachment.