I2C through FlexIO doesn't work right

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

I2C through FlexIO doesn't work right

ソリューションへジャンプ
2,650件の閲覧回数
freddy_ben-zeev
Contributor IV

I've configured I2C through FlexIO, connected it to a logic analyzer, and I send slave address plus two bytes. No slave is connected so it always gets NAK. When I use LPI2C it stops after sending the slave address and getting the NAK on it - this correct behavior. When I use the FlexIO - it continues to send the data bytes too (which also get NAK). This is wrong. After getting NAK on the slave address it should not continue.

ラベル(1)
1 解決策
2,302件の閲覧回数
cristianzamfire
NXP Employee
NXP Employee

Hello,

Due to device limitations it is not possible to tell the difference between NACK and receiver overflow (the same flag asserts in both cases). The driver attempts to detect NACK by checking the Tx shifter flag, but this is not a bullet-proof method, any delays in processing the Flexio interrupt can lead to the NACK condition not being recognized. In these cases the driver will consider that there was an overflow and not abort the transfer, because aborting a transfer while there is an active slave on the line can lead to the I2C bus getting stuck. It is safer to let the transfer finish, this will just produce a little delay.

Please check the driver documentation, these limitations are described in the "Important Notes" section.

Best regards,

Cristian

元の投稿で解決策を見る

4 返答(返信)
2,302件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Unlike LPI2C which sends STOP condition upon NACK (MSR[NDF]), the FlexIO receive shift register will assert an error interrupt if a NACK is detected, but software is responsible for generating the STOP or repeated START condition (52.5.5 I2C Master, S32K1xx RM rev.9).

BR, Daniel

0 件の賞賛
返信
2,302件の閲覧回数
freddy_ben-zeev
Contributor IV

When you say "software is responsible" doesn't it mean that the driver should handle it?

0 件の賞賛
返信
2,303件の閲覧回数
cristianzamfire
NXP Employee
NXP Employee

Hello,

Due to device limitations it is not possible to tell the difference between NACK and receiver overflow (the same flag asserts in both cases). The driver attempts to detect NACK by checking the Tx shifter flag, but this is not a bullet-proof method, any delays in processing the Flexio interrupt can lead to the NACK condition not being recognized. In these cases the driver will consider that there was an overflow and not abort the transfer, because aborting a transfer while there is an active slave on the line can lead to the I2C bus getting stuck. It is safer to let the transfer finish, this will just produce a little delay.

Please check the driver documentation, these limitations are described in the "Important Notes" section.

Best regards,

Cristian

2,302件の閲覧回数
freddy_ben-zeev
Contributor IV

Thanks for the detailed explanation! I was suspecting h/w limitations but didn't have time to hunt down the issue when functionality is fine.

0 件の賞賛
返信