2 Replies Latest reply on Mar 2, 2018 8:33 AM by maxim.adelman_2340186

    I2C Master stuck - MCSR stuck with START_GEN set


      In my CY8C5888FNI design with fixed-function master I2C interface (IP version 3.5), I see that very infrequently (on the order of once per hour under once-per-second accesses), the interface gets stuck after the SendStart() API function is called. Before calling SendStart(), I check the MCSR to make sure it is 0, which it is. Normally, after that call, the MCSR goes to 0x0C (BUS_BUSY and MSTR_MODE). However, in the stuck case, I see it set to 0x01 (START_GEN) - which is the bit that the call asserts. No amount of waiting helps - the register stays at 0x1.  SendStart() completes without error (NO_ERROR), but subsequent calls to I2C API functions fail with NOT_READY.


      I.e., it appears that in the failing scenario, I2C interface starts out as idle, SendStart seemingly completes OK (its wait for CSR WAIT_BYTE_COMPLETE succeeds), yet the MCSR gets stuck in START_GEN and never completes.


      This is quite an urgent matter, please help.




      BTW, separately I've also observed that after calling SendStop() API, MCSR infrequently stays at 0xC for some time - however this is a transient condition, where it eventually changes to 0x0. Still, seems like this an incorrect API implementation - I'd expect SendStop() to spin until the interface and the bus go idle.