2 Replies Latest reply on Mar 8, 2016 7:42 AM by jean-jacques.michel

    CY7C65211 - USB Serial SDK Examples - DeviceIndex/DeviceNumber

    jean-jacques.michel

      Hello,

         

       

         

      I am currently using the CY7C65211 from CY8CKIT-049-4200, in a project, where I have one configured as USB-Serial, AND another one as USB-I2C, on the same PC host.

         

      I have been using the source code (v2.0.3) from the SDK to access the USB-I2C one, and it seems that there might be some confusion in the usage of parameter deviceNumber in function CyGetDeviceInfoVidPid and CyOpen.

         

      In the examples (usbserialexample\(uart|spimaster|i2cmaster)), the end of the FindDeviceAtSCB0 function is returning an Index (used later in CyOpen as deviceNumber parameter) when it finds a device with the right PID/VID (+ SerialBlock_SCB0), but in my tests, it seems that it would require to pass the deviceID[index] value to CyOpen instead of only the index, when the USB-Serial one is connected too.

         

      [ When I look at the Linux source code, the CyGetDeviceInfoVidPid function is filling the UINT8* deviceNumber structure with something called 'DevNum' which looks uncorrelated to 'index', and  that would tend to confirm that using deviceID[index] should be used to get the DeviceNumber for CyOpen. ]

         

      Can someone confirm this ?

         

      JJ

         


       

        • 1. Re:  CY7C65211 - USB Serial SDK Examples - DeviceIndex/DeviceNumber
          nisa

           CY7C65211 is a single channel USB serial product, can you explain where you are getting the second channel from.  In case you have single channel then you can directly use the index value for the host to communicate. 

          • 2. Re:  CY7C65211 - USB Serial SDK Examples - DeviceIndex/DeviceNumber
            jean-jacques.michel

            I am using two CY7C65211, one as USB-Serial (default configuration on the CY8CKIT), and the other one configured as USB-I2C Master.

               

            Here is my CyGetDeviceInfoVidPid with vid=0x04b4/pid=0x0004 output :

               

            Without the USB-Serial bridge :

               
            Index = 0 Interfaces: 1 Vid: 1204 Pid:4 DeviceID: 0 SCB Number: SerialBlock_SCB0  Index = 1 Interfaces: 1 Vid: 1204 Pid:4 DeviceID: 1 SCB Number: SerialBlock_SCB1
               

            Index and DeviceID are same.

               

            With the USB-Serial bridge :

               
            Index = 0 Interfaces: 1 Vid: 1204 Pid:4 DeviceID: 1 SCB Number: SerialBlock_SCB0  Index = 1 Interfaces: 1 Vid: 1204 Pid:4 DeviceID: 2 SCB Number: SerialBlock_SCB1
               

             

               

            Index and DeviceID are now shifted by one.

               

            Trying to call CyOpen with Index value, i.e. '0' does not work - Calling it with '1' works.