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.

RTOS/CC2650: I2C Multi Master

Part Number: CC2650

Tool/software: TI-RTOS

Is multi-master still unsupported in the current I2C drivers? 

If it isn't, can anyone possibly point me in the right direction for a solution?

Thanks.

  • Hi,

    as far as I see in the API documentation of the I2C driver, it is not supported, but it shouldn't be hard to enable it:

    • Put the file I2CCC26XX.c from the tidrivers folder in the SDK into your project directory so that you can make modifications
    • I2C transactions are started in I2CCC26XX_primeTransfer(). This function gives up immediately when the bus is occupied.
    • Whenever a transaction finishes, I2CCC26XX_hwiFxn() is executed. This function checks the interrupt status and if any interrupt flag bit is set, it checks for the I2C_MASTER_ERR_ARB_LOST flag in particular and gives up immediately when arbitration failed.
            /* Some sort of error happened! */
            object->mode = I2CCC26XX_ERROR;
    
            if (errStatus & I2C_MASTER_ERR_ARB_LOST) {
                SwiP_post(&(object->swi));
            }
            else {
                /* Try to send a STOP bit to end all I2C communications immediately */
                /*
                 * I2C_MASTER_CMD_BURST_SEND_ERROR_STOP -and-
                 * I2C_MASTER_CMD_BURST_RECEIVE_ERROR_STOP
                 * have the same values
                 */
                I2CMasterControl(hwAttrs->baseAddr,
                                 I2C_MASTER_CMD_BURST_SEND_ERROR_STOP);
    
                /* Do not post SWI here to avoid subsequent transfers being stopped.
                   Wait till the stop condition interrupt to post SWI */
            }

    Now I would assume that you need to add some logic into the driver to restart arbitration certain times before giving up. Does that make sense?

  • Hello Richard,

    Thank you so much for your reply, and I realize my reply is a little late, my project was put on hold for a bit.

    So based on your statement, and what I am seeing in the current driver, is that driver does check to see if the bus is occupied, flags the arbitration error bit if it is, the above section checks the error, and terminates communication.

    All that is missing is the logic to reschedule to check if the bus is occupied and restart arbitration.

    If that is the case this would resolve my question.
  • Nicholas Nicou said:
    So based on your statement, and what I am seeing in the current driver, is that driver does check to see if the bus is occupied, flags the arbitration error bit if it is, the above section checks the error, and terminates communication.

    All that is missing is the logic to reschedule to check if the bus is occupied and restart arbitration.

    From what I can see and how I understand the existing driver, yes.