Other Parts Discussed in Thread: SYSCONFIG
Tool/software:
Hello,
I am trying to use MCU_I2C0 on the M4F after upgrading to MCU+SDK 11.0.0.15. I am using the high-level driver and the I2C_transfer() function is always returning the status I2C_STS_ERR_TIMEOUT. Previously, I was using MCU+SDK 9.1.0.41, which had I2C working correctly. I should also note that the M4F is running FreeRTOS and communicating to the A53 (running Linux) using IPC RPMsg.
Here is my code to perform an I2C transfer on the M4F:
#define I2C_BUF_SIZE 16u
#define I2C_TIMEOUT_MS 100u
uint8_t i2c_rx_buf[I2C_BUF_SIZE] = {0u};
uint8_t i2c_tx_buf[I2C_BUF_SIZE] = {0u};
I2C_Handle i2c_handle;
I2C_Transaction i2c_transaction_handle;
static int32_t i2c_transfer_msg(uint8_t i2c_send_buf[], uint8_t send_buf_len, uint8_t i2c_recv_buf[], uint8_t recv_buf_len, uint8_t i2c_addr)
{
if ((i2c_send_buf == NULL) || (i2c_recv_buf == NULL)) // Ensure the pointers aren't NULL
{
return I2C_STS_ERR;
}
memset(i2c_rx_buf, 0, I2C_BUF_SIZE); // Clear the I2C Rx buffer
int32_t status;
i2c_transaction_handle.targetAddress = i2c_addr;
i2c_transaction_handle.writeBuf = i2c_send_buf;
i2c_transaction_handle.writeCount = send_buf_len;
i2c_transaction_handle.readBuf = i2c_recv_buf;
i2c_transaction_handle.readCount = recv_buf_len;
i2c_transaction_handle.timeout = I2C_TIMEOUT_MS;
//i2c_transaction_handle.controllerMode = true;
//i2c_transaction_handle.expandSA = false;
status = I2C_transfer(i2c_handle, &i2c_transaction_handle);
if (status != I2C_STS_SUCCESS)
{
status = I2C_recoverBus(gI2cHandle[CONFIG_I2C0], I2C_TIMEOUT_MS);
}
memset(i2c_tx_buf, 0, I2C_BUF_SIZE); // Clear the I2C Tx buffer
return status;
}
Here is my sysconfig for I2C:
I should also note that MCU_I2C0 did not initialize correctly until I changed this line in the I2C_open() function found in ${MCU+SDK}/source/drivers/i2c/v0/i2c_v0.c.

I have I/O connected to I2C, and it would be really nice to get it working with this new MCU+SDK version.
Thanks for your help!

