AnsweredAssumed Answered

Having a lockup in the I2C code

Question asked by Jeff JAcobson on Mar 21, 2018
Latest reply on Oct 2, 2019 by Kerry Zhou

I am using lpcopen_2_10_keil_iar_nxp_lpcxpresso_1769 and having random lockups in this code in bold:

/* Chip event handler interrupt based */
void Chip_I2C_EventHandler(I2C_ID_T id, I2C_EVENT_T event)
    struct i2c_interface *iic = &i2c[id];
    volatile I2C_STATUS_T *stat;


    /* Only WAIT event needs to be handled */
    if (event != I2C_EVENT_WAIT) {


    stat = &iic->mXfer->status;
    /* Wait for the status to change */
    while (*stat == I2C_STATUS_BUSY) {}


My code will run sometimes minute, sometimes once. When it hangs it is always there. The fact that a library has a dead loop is bad enough.

Has anyone seen issues with these libraries? Any thoughts on could be hanging the I2C bus? I scoped the lines and power and all are very clean.


Any direction would be great.


Thanks, Jeff