2 Replies Latest reply on Jan 19, 2017 1:42 PM by YermiA_Intel

    I2C - hanging in write function

    mark_kram

      I'm trying to send some data via I2C interface as below

       

       

      #define MAX_RETRY_COUNT 5

      int retry_count = 0;

      qm_i2c_status_t status = 0;

      qm_i2c_status_t *ptr_status = &status;

      uint8_t all_data[] = {0b00000000, 0b01000000}; //cmd + on

       

       

      /* Master read all registers*/

      while ((qm_i2c_master_write(QM_I2C_0, SSD1306_ADDRESS_WRITE, all_data, sizeof(all_data), true, ptr_status) != 0) && (retry_count < MAX_RETRY_COUNT)) {

      retry_count++;

      }

       

       

      but nothing is sent and program is hanged into below "while" any idea why ?

       

       

      /* this is a blocking call, wait until FIFO is empty or tx abrt

      * error */

      while (!(controller->ic_status & QM_I2C_IC_STATUS_TFE))

        ;