AnsweredAssumed Answered

LPC4367 I2C stuck in interrupt handler

Question asked by Jochem van der Meer on Oct 24, 2018
Latest reply on Oct 30, 2018 by Kerry Zhou

I am using an LPC4367 on an OM13084 development board, this board is connected to another system using I2C (I2C bus 1 on the LPC4367) as a slave. There are also two sensors connected to the same I2C bus, which I read out using the LPC4367 a I2C master. I'm using the lpcopen libraries 3.02. All communciation over the I2C bus is handled via interrupt.

 

Receiving data from the other system is not a problem, I'm receiving everything that is send over the bus correct.

But when I try to read data from the sensors connected to the bus with the LPC4367, the program gets stuck in the

"Chip_I2C_EventHandler()" at random moments (after a couple of hours). 

 

/* 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) {
        return;
    }

 

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

 

When this happens the status of the I2C bus is stuck at "I2C_STATUS_BUSY"

Any idea what can be causing this and how to fix this?

Outcomes