Linux device driver for cyfxusbi2cregmode example?

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

cross mob
Anonymous
Not applicable

Are there any Linux device drivers which will work with the cyfxusbi2cregmode example, e.g. so that a i2c device would be available in /sys/bus/i2c/devices?

   

Or any Linux driver which would be suitable to modify?

0 Likes
5 Replies
Anonymous
Not applicable

Or can the  CyUSBSerialTestUtility (http://www.cypress.com/file/123336/download) be modified to work with the cyfxusbi2cregmode or similar?

0 Likes
Anonymous
Not applicable

libusb and libusb_control_transfer seem to be the answer. See this thread:

   

http://www.cypress.com/forum/usb-30-super-speed/fx3-i2c-simple-example

   

Again, I'm getting a timeout when calling libusb_control_transfer and CyU3PUsbSendEP0Data responds on the FX3 side. Could the timeout be due to this problem?

   

http://www.cypress.com/forum/usb-known-problems-and-solutions/cyu3pusbsendep0data-fail-timeout

   

There are no DMA transfers in the cyfxusbi2cregmode.c example. By adding a print statement I can see that the CyU3PUsbSendEP0Data in the CY_FX_RQT_ID_CHECK returns.

   

Is there a pre-built image available for the cyfxusbi2cregmode example? Just to rule out any build problems and wrong elf2img options (as I'm building on Linux)

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

1) Please find a working .img attached as a zip

   

2)  the device won't come under I2C device. It will come as a USB vendor device. (for the host PC, it is just a USB device)

   

3) You cannot use CyUSBSerialTestUtility with this firmware. CyUSBSerialTestUtility  for USB-Serial family (not for FX3 family)

   

4) If you want to check the I2C read write functionality, then you need to use Vendor commands just like mentioned in the above link you shared.

0 Likes
Anonymous
Not applicable

Thank you Nishant,

   

Actually That's what I've been testing, see the thread:

   

http://www.cypress.com/forum/usb-30-super-speed/fx3-i2c-simple-example

   

However, I do get a timeout, both when using my own code, and the cyusb_linux GUI tool when trying to get the glFirmwareID using CY_FX_RQT_ID_CHECK. The result is the same with the image you provided in the zip file above as the one I've built from the cyfxusbi2cregmode.c source.

0 Likes
Anonymous
Not applicable

I tried communicating with an I2C EEPROM using the Cypress USBFlashProg example. It worked, but please note the you will have to set the bmRequest type accordingly. I see that you were trying to use 0x40,but I request you to use 0xC0.

   

0x40 is a 7 bit value. The 8th bit is to indicate the direction of transfer in or out

   

Also, please restart the cyusb_linux application after you program the device. I noticed that sometimes the cyusb_linux does not get updated after the device is programmed.

0 Likes