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.
Tool/software:
Hi TI team,
I am using pdk_jacinto_09_02_00_30 of ti-processor-sdk-rtos-j721e-evm-09_02_00_05 and I am trying to read data from an IO expander using I2C0 of main domain using MCU1_0.
I took eeprom_read test as reference to configure the I2C channel, but when I try to read data from the device, I get a timeout error.
I2C_HwAttrs i2cCfg;
I2C_Params i2cParams;
I2C_Handle handle;
I2C_Transaction i2cTransaction;
int16_t status;
I2C_init();
I2C_socGetInitCfg(0U, &i2cCfg);
i2cCfg.baseAddr = CSL_I2C0_CFG_BASE;
i2cCfg.enableIntr = 0U;
I2C_socSetInitCfg(0U, &i2cCfg);
I2C_Params_init(&i2cParams);
i2cParams.transferMode = I2C_MODE_BLOCKING;
i2cParams.bitRate = I2C_100kHz;
handle = I2C_open(0U, &i2cParams);
if(NULL == handle)
{
UART_printf("I2C open FAILED!\n");
}
else
{
UART_printf("I2C open SUCCEEDED\n");
}
uint8_t reg = 0x02;
uint8_t data = 0U;
I2C_transactionInit(&i2cTransaction);
i2cTransaction.slaveAddress = 0x74;
i2cTransaction.writeBuf = ®
i2cTransaction.writeCount = 1U;
i2cTransaction.readBuf = &data;
i2cTransaction.readCount = sizeof(data);
i2cTransaction.timeout = 100U;
status = I2C_transfer(handle, &i2cTransaction);
if(I2C_STS_SUCCESS != status)
{
DEBUG_LOG("Read Data Transfer failed. Status: %d", status);
}
Am I missing something?
Hi,
Are you able to successfully run the I2C eeprom read example?
Is this issue occurring on a TI EVM or custom board?
Thanks,
Neehar
Hi,
I have not run I2C eeprom read example, but I have other io expanders connected to I2C0 of main domain (CSL_MCU_I2C0_CFG_BASE) and I2C0 of wake up domain (CSL_WKUP_I2C0_CFG_BASE). In those channels, I am able to read data properly using this algorithm.
The issue is occurring in a custom board that use to run with sdk7, and we are migrating to sdk9.
Thanks,
Sergio
Hi Sergio,
but I have other io expanders connected to I2C0 of main domain (CSL_MCU_I2C0_CFG_BASE)
Can you test with using I2C_WAIT_FOREVER as the timeout value? Additionally, are you operating in blocking or callback mode?
Thanks,
Neehar
Hi,
I solved the issue. A72 was stuck at uboot, after uboot starts Linux, main domain I2C0 becomes active, and it is possible to read data properly.
Thanks,
Sergio