This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSPM0G3507: I2C NACK Controller Hangs

Part Number: MSPM0G3507


Tool/software:

Once put the data in the "DL_I2C_startControllerTransfer" process and I2C got NACK set due to slave has not responded. So, the I2C controller getting hanged further not able to re-transmit the data.

while (DL_I2C_getControllerStatus(I2C_0_INST) &
    DL_I2C_CONTROLLER_STATUS_ERROR) {
   
}

Once Error occurred these ERR,ADRACK,ARBLST and IDLE flags all are set.

How to clear those errors flags and continue I2C master data re-transmission again.

  • DL_I2C_startControllerTransfer() sets STOP, so the I2C unit has issued a Stop and the transaction is over. You can go ahead and start it again.

    I recommend:

    1) Wait until IDLE is set since that doesn't happen immediately [observed behavior]

    2) Empty the TX and/or RX FIFOs (as appropriate) before restarting, since that doesn't happen automatically.

  • Hi Baskar,

    If you call the "DL_I2C_startControllerTransfer", it will automatically generate the STOP signal.

    And normally we do not poll the error status to track, see what the sdk example do:

        /* Poll until the Controller writes all bytes */
        while (DL_I2C_getControllerStatus(I2C_INST) &
               DL_I2C_CONTROLLER_STATUS_BUSY_BUS)
            ;
    
        /* Trap if there was an error */
        if (DL_I2C_getControllerStatus(I2C_INST) &
            DL_I2C_CONTROLLER_STATUS_ERROR) {
            /* LED will remain high if there is an error */
            __BKPT(0);
        }
    
        /* Wait for I2C to be Idle */
        while (!(
            DL_I2C_getControllerStatus(I2C_INST) & DL_I2C_CONTROLLER_STATUS_IDLE))
            ;
    
    

    You can find the example below:

    i2c_controller_rw_multibyte_fifo_poll.c

    B.R.

    Sal