libusb and libusb_control_transfer seem to be the answer. See this thread:
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?
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)
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.
UsbI2cRegMode.zip 45.0 K
Thank you Nishant,
Actually That's what I've been testing, see the thread:
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.
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.