cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

maric_3991151
New Contributor

I'm having problems in sending consecutive "CyU3PI2cSendCommand" commands.

I modified the FX3 i2c example in this way:

            case CY_FX_RQT_I2C_EEPROM_WRITE:

                status  = CyU3PUsbGetEP0Data(wLength, glEp0Buffer, NULL); // Here I receive the data

// Here I'm trying to send 4 times the same message...

                if (status == CY_U3P_SUCCESS)

                {

                    CyFxUsbI2cTransfer (wIndex, i2cAddr, wLength,

                    glEp0Buffer, CyFalse);

                }

                if (status == CY_U3P_SUCCESS)

                {

                    CyFxUsbI2cTransfer (wIndex, i2cAddr, wLength,

                    glEp0Buffer, CyFalse);

                }

                if (status == CY_U3P_SUCCESS)

                {

                    CyFxUsbI2cTransfer (wIndex, i2cAddr, wLength,

                    glEp0Buffer, CyFalse);

                }

                if (status == CY_U3P_SUCCESS)

                {

                    CyFxUsbI2cTransfer (wIndex, i2cAddr, wLength,

                    glEp0Buffer, CyFalse);

                }

                break;

Observing SDA and SCL with an oscilloscope, the weird thing is that if data has "wLength" up to 33 bytes, all transactions go fine, while if wLength is 34 or more, only the first transaction goes through.

0 Likes
1 Solution
SrinathS_16
Moderator
Moderator

Hello,

- I modified the UsbI2cDmaMode example that comes with the FX3 SDK as you have mentioned. I am able to see all the I2C transactions on the analyzer. Please find the attached capture files. (Use Logic software from Saleae Logic to view the .logicdata file).

- Please ensure that you have captured for sufficiently long time so that the transfers are completed.

- If possible, please share the captures that were collected at your end.

Best regards,

Srinath S

View solution in original post

0 Likes
2 Replies
SrinathS_16
Moderator
Moderator

Hello,

- I modified the UsbI2cDmaMode example that comes with the FX3 SDK as you have mentioned. I am able to see all the I2C transactions on the analyzer. Please find the attached capture files. (Use Logic software from Saleae Logic to view the .logicdata file).

- Please ensure that you have captured for sufficiently long time so that the transfers are completed.

- If possible, please share the captures that were collected at your end.

Best regards,

Srinath S

View solution in original post

0 Likes
maric_3991151
New Contributor

Hi SrinathS_16, thank you for your feedback. It helped me to understand the problem.

I was sending the data to an I2C slave (not the same of UsbI2cDmaMode example) with a rx buffer that was too small to receive the whole transfer.

0 Likes