- Check if size of stack is sufficient.
- Stack adequate, no overflow
- Try to disable both instruction and data cache to confirm that this is not related to some coherency issues.
- The cache function is not enabled and is not used
- If it is possible, try to disable unnecessary features/functions in your code to make the project as simple as possible. If it helps, then enable the functions one by one to see what makes the difference.
- Disable code found I2C initialization function I2C_DRV_MasterInit masked, there will be no feedback issues. At the same time, I did a test, open I2C initialization function I2C_DRV_MasterInit, and mask all applications that use I2C function, there will still be the problem of feedback.
The following is the i2c initialization code
/****************************************************************************
* Macro Definitions
*****************************************************************************/
#define IICHAL_CHANNEL_MAX_NUM 1u
/*****************************************************************************************
* Internal Variable Definitions
******************************************************************************************/
i2c_master_state_t i2c1MasterState;
/*****************************************************************************************
* Global Variable Definitions
******************************************************************************************/
const uint32 IicInstanceConfig [IICHAL_CHANNEL_MAX_NUM] =
{
INST_I2C1,
};
const i2c_master_user_config_t* IicUserConfig [IICHAL_CHANNEL_MAX_NUM] =
{
&i2c1_MasterConfig0,
};
const i2c_master_state_t* IicMasterConfig [IICHAL_CHANNEL_MAX_NUM] =
{
&i2c1MasterState,
};
Std_ReturnType IicHal_MasterInit(IicHal_IdType Id)
{
#if(IICHAL_DEBUG_1 == STD_ON)
if(Id < IICHAL_CHANNEL_MAX_NUM)
#endif
{
if( I2C_DRV_MasterInit( IicInstanceConfig[Id],IicUserConfig[Id],IicMasterConfig[Id] ) == STATUS_SUCCESS )
return ERR_FLAG_OK;
}
return ERR_FLAG_FAULT;
}