- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Solved! Go to Solution.
- Labels:
-
PSOC5 LP MCU
- Tags:
- Generated Code
- i2c
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.