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.

C6657 I2C例程超时不返回

Other Parts Discussed in Thread: SYSBIOS

在C6657 EVM开发板上按照sysbios例程对0x20(无该设备)操作,虽然设置了超时时间,但是仍然阻塞在I2C_transfer不返回,看不到I2C_transfer源码,不知道如何调试,I2C代码如下:

I2C_transactionInit(&i2cTransaction);
i2cTransaction.slaveAddress = 0x20;
i2cTransaction.writeBuf = (uint8_t *)&txBuf[0];
i2cTransaction.writeCount =4;
i2cTransaction.readBuf = NULL;
i2cTransaction.readCount = 0;
i2cTransaction.timeout = 2/*I2C_TRANSACTION_TIMEOUT*/;
transferStatus = I2C_transfer(handle, &i2cTransaction);


if(I2C_STS_SUCCESS != transferStatus)
{
I2C_log("\n Data Transfer failed. \n");
}

  • 您意思是0x20下没有挂I2C设备,但是您在对它进行读写对吗?不太明白这个动作意义何在

    I2C_transfer源代码在PDK下可以找到的

  • 你好,I2C总线上可能连接多个设备,我需要通过轮询读取设备ID来识别。现在非sysbios的I2C配置已经正常了(说明硬件连接没问题),但是使用sysbios的I2C例程就存在这个问题,就算设置了超时时间,也依然被阻塞了,不知道为什么。

    I2C_transfer跑到i2c_drv.c之后就不知道到哪去了。

    int16_t I2C_transfer(I2C_Handle handle, I2C_Transaction *transaction)
    {
    /* Input parameter validation */
    OSAL_Assert(!((handle != NULL) && (transaction != NULL)));

    return (handle->fxnTablePtr->transferFxn(handle, transaction));
    }

    另外,麻烦推进一下这两个问题,关于以太网和UPP的,比较重要,在此感谢了!

    http://www.deyisupport.com/question_answer/dsp_arm/c6000_multicore/f/53/t/124200.aspx
    http://www.deyisupport.com/question_answer/dsp_arm/c6000_multicore/f/53/t/124708.aspx