Tool/software:
I am using the MCU_I2C instance from M4F core on AM64x device. I am not able to initialize the MCU_I2C instance and it always fails to open.
I am using SDK v10.0. Please guide us with steps to fix the same.
Tool/software:
I am using the MCU_I2C instance from M4F core on AM64x device. I am not able to initialize the MCU_I2C instance and it always fails to open.
I am using SDK v10.0. Please guide us with steps to fix the same.
The I2C driver seems to be broken after the release of SDK v10.0 to SDK v11.0.
The I2C_lld_isBaseAddrValid() API is returning failure status because the MCU_I2C addresses are not checked. Please replace the I2C_lld_isBaseAddrValid function code with below provided code. The I2C_lld_isBaseAddrValid is located at ${MCU+SDK}/source/drivers/soc/am64x_am243x/soc.h file.
static inline int32_t I2C_lld_isBaseAddrValid(uint32_t baseAddr) { /* Set status to invalid Param */ int32_t status = (int32_t)(-3); if ( (baseAddr == CSL_I2C0_CFG_BASE) || \ (baseAddr == CSL_I2C1_CFG_BASE) || \ (baseAddr == CSL_I2C2_CFG_BASE) || \ (baseAddr == CSL_I2C3_CFG_BASE) || \ (baseAddr == (uint32_t)AddrTranslateP_getLocalAddr(CSL_MCU_I2C0_CFG_BASE)) || \ (baseAddr == (uint32_t)AddrTranslateP_getLocalAddr(CSL_MCU_I2C1_CFG_BASE)) ) { /* Set status to success */ status = 0; } return status; }
Also include the AddrTranslateP.h file in the soc.h file.
Also replace the code in I2C_open function as described in below image.
gmake -s libs PROFILE={release|debug} clean gmake -s libs PROFILE={release|debug}