cancel
Showing results for 
Search instead for 
Did you mean: 

USB Low-Full-High Speed Peripherals

Anonymous
Not applicable

Hi,

we are using this (CY7C65215)chip set for converting USB port to Spi interface.

(Desktop-PC)Linux is at the USB port and spi device at the other end.

our Questions on this are

(1)when we connect to Desktop pc how it is enemurated?

Ex:a)we will first see lsusb there we can get the vendor id and product id:

b)As we are keeping spi on other end it should be shown as a device node in /dev/ttyXXX

The above device node /dev/ttyXXX is not shown in our device when we connected to Desktop pc

Is there any driver installation required for this board in linux.

I have seen some cypress configuration in kernel configuration may i know what these configurations for

kmod-usb-serial-cypress-m8

This configuration is to be enabled or disabled ? for the above interface.

What are the drivers required in linux to enable and enumerate the device in /dev/ttyXXX?

Thanks in advance.

Thanks

Sujith

0 Likes
1 Solution
Sananya_14
Moderator
Moderator

Hello Sujith,

We were able to check the I2C and SPI write/read operations as per your page address and length and both were successful.The Test Utility will only be able to communicate with the on-board I2C/SPI EEPROMS, please ensure that the jumper settings are proper if you are using our DVK. If you are using your own I2C/SPI device please ensure that the address and memory array is same as those used in our DVK.

Best Regards,

Sananya

View solution in original post

0 Likes
4 Replies
Sananya_14
Moderator
Moderator

Hi Sujith,

The device will be visible under the /dev/ttyXXX node if it Is configured for UART interface and binds to CDC ACM driver. If it is configured for SPI interface, it will come up as a vendor device and no specific drivers will be required since Libusb library is used to communicate with the device which is also provided in the USB-Serial Linux SDK. Please verify if the device enumerates properly with the dmesg command.

Please attach a screenshot where the Kernel configuration is displayed.

Best Regards,

Sananya

0 Likes
Anonymous
Not applicable

Hi Sanm,

Thanks for the reply,

I am attaching a screenshot for kernel configuration and also i have seen libusb sdk and test utility library for testing spi and i2c working or not?

we found the below errors

when configured as spi device we got error like:Data corruption occured!!

when configured as i2c device we got error like:Error in doing i2c write

attached the above two logs too

can you please  help us  why this happens and also how to resolve it.

kernel configuration:

cypress.png

============================================================================

log for spi configuration:

root@hp:~/Downloads/spi/CyUSBSerial_SDK_Linux/CyUSBSerial_SDK_Linux/linux/testUtility$ sudo ./CyUSBSerialTestUtility

---------------------------------------------------------------------------------

Device Number | VID | PID | INTERFACE NUMBER | FUNCTIONALITY

---------------------------------------------------------------------------------

0             |4b4  |a    | 0     | VENDOR_SPI

0             |4b4  |a    | 1     | VENDOR_I2C

0             |4b4  |a    | 2     | NA

---------------------------------------------------------------------------------

-------------------------------------------------------------------

1: Print list of devices

2: Select device...No device selected !!

3: Enter I2C/SPI Flash page address and length to write/read.

4: Verify data

5: Exit

-------------------------------------------------------------------

2

Enter Device number to be selected..

0

Enter interface number..

0

-------------------------------------------------------------------

1: Print list of devices

2: Change device selection--selected device: [Device number 0] : [Interface No 0] : SPI

3: Enter I2C/SPI Flash page address and length to write/read.

4: Verify data

5: Exit

-------------------------------------------------------------------

3

Enter Page address... (less than 65536)

1234

Enter length to read/write...(less than 256)

32

-------------------------------------------------------------------

1: Print list of devices

2: Change device selection--selected device: [Device number 0] : [Interface No 0] : SPI

3: Change Flash page address and length ...Entered is page address 1234 and length 32

4: Verify data

5: Exit

-------------------------------------------------------------------

4

Calling spi write enable

The Data written is ...

--------------------------------------------------------------------

67 c6 69 73 51 ff 4a ec 29 cd ba ab f2 fb e3 46 7c c2 54 f8 1b e8 e7 8d 76 5a 2e 63 33 9f c9 9a

--------------------------------------------------------------------

Data Read back is

---------------------------------------------------------------------

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

---------------------------------------------------------------------

Data corruption occured!!

-------------------------------------------------------------------

1: Print list of devices

2: Change device selection--selected device: [Device number 0] : [Interface No 0] : SPI

3: Change Flash page address and length ...Entered is page address 1234 and length 32

4: Verify data

5: Exit

-------------------------------------------------------------------

==============================================================================

=============================================================================

log for I2C configuration:

root@hp:~/Downloads/spi/CyUSBSerial_SDK_Linux/CyUSBSerial_SDK_Linux/linux/testUtility$ sudo ./CyUSBSerialTestUtility

---------------------------------------------------------------------------------

Device Number | VID | PID | INTERFACE NUMBER | FUNCTIONALITY

---------------------------------------------------------------------------------

0             |4b4  |a    | 0     | VENDOR_SPI

0             |4b4  |a    | 1     | VENDOR_I2C

0             |4b4  |a    | 2     | NA

---------------------------------------------------------------------------------

-------------------------------------------------------------------

1: Print list of devices

2: Select device...No device selected !!

3: Enter I2C/SPI Flash page address and length to write/read.

4: Verify data

5: Exit

-------------------------------------------------------------------

2

Enter Device number to be selected..

0

Enter interface number..

1

-------------------------------------------------------------------

1: Print list of devices

2: Change device selection--selected device: [Device number 0] : [Interface No 1] : I2C

3: Enter I2C/SPI Flash page address and length to write/read.

4: Verify data

5: Exit

-------------------------------------------------------------------

3

Enter Page address... (less than 256)

124

Enter length to read/write...(less than 64)

32

-------------------------------------------------------------------

1: Print list of devices

2: Change device selection--selected device: [Device number 0] : [Interface No 1] : I2C

3: Change Flash page address and length ...Entered is page address 124 and length 32

4: Verify data

5: Exit

-------------------------------------------------------------------

4

Calling I2C

Data that is written on to i2c ...

-----------------------------------------------------------------

67 c6 69 73 51 ff 4a ec 29 cd ba ab f2 fb e3 46 7c c2 54 f8 1b e8 e7 8d 76 5a 2e 63 33 9f c9 9a

-----------------------------------------------------------------

Error in doing i2c write

-------------------------------------------------------------------

1: Print list of devices

2: Change device selection--selected device: [Device number 0] : [Interface No 1] : I2C

3: Change Flash page address and length ...Entered is page address 124 and length 32

4: Verify data

5: Exit

-------------------------------------------------------------------

===========================================================================

Thanks

Sujith

0 Likes
Sananya_14
Moderator
Moderator

Hello Sujith,

We were able to check the I2C and SPI write/read operations as per your page address and length and both were successful.The Test Utility will only be able to communicate with the on-board I2C/SPI EEPROMS, please ensure that the jumper settings are proper if you are using our DVK. If you are using your own I2C/SPI device please ensure that the address and memory array is same as those used in our DVK.

Best Regards,

Sananya

View solution in original post

0 Likes
Anonymous
Not applicable

Awesome thanks...

0 Likes