Part Number: TDA2EG
Hi
i am try to test the I2C example "pdk_01_08_00_16\packages\ti\drv\bsp_lld\i2c\examples\i2c_utility".
The default I2C instance is I2C1, and i want to use the I2C5, because my SOC is TDA2Ex.
I do not have the CCS connector, so i directly changed the src code as follows:
From the "pdk_01_08_00_16\packages\ti\drv\vps\src\boards\src\bsp_boardTda2xx.c", in the definition of gBoardTda2xxI2cInstData:
#if defined (SOC_TDA2PX)
#ifndef BSP_DISABLE_I2C4
{
BSP_DEVICE_I2C_INST_ID_4, /* instId */
SOC_I2C5_BASE, /* baseAddr */
CSL_INTC_EVENTID_I2CINT5, /* intNum */
400U /* busClkKHz */
}
#endif
#endif
i just removed the SOC_TDA2PX condition judgment to open the I2C5 as follows:
#if defined (SOC_TDA2PX)
#ifndef BSP_DISABLE_I2C4
{
BSP_DEVICE_I2C_INST_ID_4, /* instId */
SOC_I2C5_BASE, /* baseAddr */
CSL_INTC_EVENTID_I2CINT5, /* intNum */
400U /* busClkKHz */
}
#endif
#endif
But my app stuck at the Bsp_deviceI2cInit function of "pdk_01_08_00_16\packages\ti\drv\vps\src\devices\src\bsp_deviceI2c.c":
when the "i2cInstId" is "BSP_DEVICE_I2C_INST_ID_4", the app will be stuck at the GIO_construct:
ioParams.packets = &(gBspDevObj.i2cIomPacket[i2cInstId][0]);
BspUtils_memset(ioParams.packets, 0, (ioParams.numPackets * sizeof (IOM_Packet)));
GIO_construct(&gBspDevObj.i2cGioStruct[i2cInstId], i2cDevName,
(UInt) GIO_INPUT, &ioParams, &eb);
(app can not step forward anymore)
gBspDevObj.i2cHndl[i2cInstId] = GIO_handle(
&gBspDevObj.i2cGioStruct[i2cInstId]);
And when the i2cInstId is BSP_DEVICE_I2C_INST_ID_0~3, the GIO_construct is normal.
So i want to ask that how to initialize the I2C5 (BSP_DEVICE_I2C_INST_ID_4) instance correctly?
Thanks
xuanbo