Problems with CyU3PI2cSendCommand with DMA

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

cross mob
maric_3991151
Level 1
Level 1

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
lock attach
Attachments are accessible only for community members.
SrinathS_16
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

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
lock attach
Attachments are accessible only for community members.
SrinathS_16
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

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

0 Likes

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