cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1

CyCP
New Contributor II

Hi,

I have a weird issue with I2C (Master) generated code.
Sometimes the generated function 'I2C_MasterSendStart' fails (even if the bus is free) with error code 'I2C_MSTR_NOT_READY'.
I've found 'strange values' of the 'I2C_state' variable on such occasions. With 'strange values', I mean values (like, for instance, 0xD2) that, looking at the whole generated code, it cannot assume (memory corruption or am I missing something?).

Again, in such occasions, if I reset it to its default value (namely 'I2C_state = I2C_SM_IDLE;') then the I2C communication works again.

Could you please shed some light on this issue?

0 Likes
1 Solution
CyCP
New Contributor II

Never mind, I found it.

It was 'exactly' a memory corruption problem,  a bug of my code (.map file was helpful), my bad.

Solved now.

View solution in original post

0 Likes
3 Replies
Hari
Moderator
Moderator

Hi @CyCP 

 

Are you using the I2C master code example that we have for the device? If a custom project is used, please share the project so that we can reproduce the error at our end. 

Is this a multi-master configuration? Or is the PSoC the only master in the bus?

 

Best regards, 
Hari

0 Likes
CyCP
New Contributor II

Hi, 

Thank you for your reply.

Unfortunately, I cannot share the project, and anyway you don't have the corresponding hardware to run it.  Please let me know if I can provide any other useful detail.

The PSoC 5  (CY8C58888LTI) is the only master on the bus. All the (7) slaves  are PSoC4 (CY8C4245PVI).

Best regards.

 

0 Likes
CyCP
New Contributor II

Never mind, I found it.

It was 'exactly' a memory corruption problem,  a bug of my code (.map file was helpful), my bad.

Solved now.

View solution in original post

0 Likes