How do you recover after a NAK from I2C_RTOS_Transfer?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How do you recover after a NAK from I2C_RTOS_Transfer?

跳至解决方案
1,031 次查看
tfont
Contributor I

I'm using MCUXpresso V10.2.1 and the V2.4.1 SDK for the FRDM-KL27Z.

I can't seem to re-use the I2C handle after getting a kStatus_I2C_Nak when calling I2C_RTOS_Transfer.  Each access after the NAK gives me an kStatus_I2C_ArbitrationLost.  I've tried calling I2C_RTOS_Init again and I've also tried calling I2C_RTOS_Deinit then I2C_RTOS_Init but no matter what, I always get an Arbitration Lost.

Is there some other way to reset the peripheral?  What's the recommended way to recover from a NAK or an Arbitration Loss?

0 项奖励
回复
1 解答
865 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi Anthony,

It seems you have multimaster on i2c bus. I2C_RTOS_Deinit does not clear S.ARBL. You can use I2C_CheckAndClearError(...) to clear it. This function is in fsl_i2c.c.

Regards,

Jing

在原帖中查看解决方案

1 回复
866 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi Anthony,

It seems you have multimaster on i2c bus. I2C_RTOS_Deinit does not clear S.ARBL. You can use I2C_CheckAndClearError(...) to clear it. This function is in fsl_i2c.c.

Regards,

Jing