CY7C65211 - USB Serial SDK Examples - DeviceIndex/DeviceNumber

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

cross mob
JeMi_1216496
Level 1
Level 1
First like given

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

   


 

0 Likes
1 Solution

Replying to myself 3 years after...

Looks like the problem was the same than :

CY7C65215-32LTXI Device Open Failed if There are several Devices with FX3 Chipset

And using deviceID[index] instead of index has been labelled as 'Correct Answer'

View solution in original post

0 Likes
3 Replies
Anonymous
Not applicable

 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. 

0 Likes

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.

0 Likes

Replying to myself 3 years after...

Looks like the problem was the same than :

CY7C65215-32LTXI Device Open Failed if There are several Devices with FX3 Chipset

And using deviceID[index] instead of index has been labelled as 'Correct Answer'

0 Likes