I2C Slave Receive Data does not match Master Send data count

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

cross mob
GaryLim
Employee
Employee
10 questions asked First like received 10 replies posted

I am using the Modustoolbox 2.4 with PSoC4. 

The PSoC4 I2C Slave has an observable strange behavior:

With a sufficiently large buffer allocated to Cy_SCB_I2C_SlaveConfigWriteBuf(), the write buffer will have no size issue for the I2C Master to write the data. There should not be any data overflow.

The Cy_SCB_I2C_SlaveGetWriteTransferCount() will report Length Received less than the I2C Master byte sent. This causes some of the master I2C data to be lost. The interrupt event is 0x20 indicates that I2C Master has finished writing the data. Within the interrupt service, the I2C status is 0x60. This indicates that master attempted to write more bytes than space available in the configured Write buffer.

Master I2C Byte length Sent

I2C Slave Reports Byte Length Received

1

1

2

2

3

3

4

4

5

5

6

6

7

7

8-16

8

17-24

16

25-32

24

33-40

32

41-48

40

49-56

48

57-64

56

 

Please check and see if the Modustoolbox 2.4 CY_SCB_I2C_SLAVE library needs any update.
Thanks.

0 Likes
1 Solution
GaryLim
Employee
Employee
10 questions asked First like received 10 replies posted

I have managed to resolve my issue while tracking back from the original sample code. It turns out that I did some printfs in the Interrupt handler which cause this strange behavior. Removing the print statements resolve the isssue. Thanks.

View solution in original post

0 Likes
3 Replies
ncbs
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 sign-ins

Hi @GaryLim,

This is a strange behavior. Can you confirm whether the configuration/parameters of master goes in hand with the slave? Can you share a project where you observe these differences?

Regards,
Nikhil

0 Likes
GaryLim
Employee
Employee
10 questions asked First like received 10 replies posted

I have managed to resolve my issue while tracking back from the original sample code. It turns out that I did some printfs in the Interrupt handler which cause this strange behavior. Removing the print statements resolve the isssue. Thanks.

0 Likes
ncbs
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 sign-ins

Hi @GaryLim ,

Glad your query is resolved.

Feel free to post any queries or issues you may have on Infineon products in the community and we will be happy to help.

Regards,
Nikhil

0 Likes