Is there any way to recover I2C bus to come out of time out conditions on i.MX287?

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any way to recover I2C bus to come out of time out conditions on i.MX287?

456 Views
英库李
Contributor I

Is there any way to recover I2C bus to come out of time out conditions on i.MX287?

Tags (2)
0 Kudos
10 Replies

210 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi 英

if i.MX28 fails to become the bus master,

the I2C_STAT.MASTER_LOSS_IRQ_SUMMARY bit will be set and

one should not start any i2c transaction when the bus is not free.

Apart from the i2c peripheral, AHB-APBX DMA channel corresponding to

the i2c should also be reset when i2c transaction error. The DMA channel

can be reset by writing channel to HW_APBX_CTRL1_CLR and then write

to  HW_APBX_CHANNEL_CTRL_SET.

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

210 Views
英库李
Contributor I

Hi igor

We try as follow, but the i.MX28 still could not become the bus master

==== map_apbx=0x80024000, 02020000 =0x2020000

==== old: hw_apbx_channel =0x400000

==== old: hw_apbx_ctrl1 =0x400000

==== new: hw_apbx_ctrl1 =0x0

==== new: hw_apbx_i2c0 reset =0x400000

is there something wrong?

0 Kudos

210 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi 英

had you tried SFTRST register HW_I2C_CTRL0 ?

~igor

0 Kudos

210 Views
英库李
Contributor I

Hi igor

We tried SFTRST register HW_I2C_CTRL0 just now,but the bus was still not free.

And We read the registers that followed

***old: map_i2c0=0x80058000, i2c0_ctrl0=0x0

***new: map_i2c0=0x80058000, i2c0_ctrl0=0x2020000

: i2c_ctrl0=0x20a0000

***old: i2c0_VERSION(0104 0000)=0x1040000

***old: i2c0_TIMING0=0x780030

***old: i2c0_TIMING1=0x800030

***old: i2c0_CTRL1=0x6886ff00

***old: i2c0_STAT=0xc0000000

***old: i2c0_queue control=0x0

***old: i2c0_queue status=0x2020

***old: i2c0_queue command=0x0

***old: i2c0_read data =0x0

***old: i2c0_write data =0x0

0 Kudos

210 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi 英

are you sure that bus is hold by i.MX28 and

not other i2c device ? Try to disconnect them .

~igor

0 Kudos

210 Views
英库李
Contributor I

Hi igor

If the bus is hold by other devices, is there any to recover it except to reset the devices?

However after we reboot the OS, the I2C will be OK

Thanks

0 Kudos

210 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi 英

general procedure for external device is

put SDA as an input and send 9 clock pulses down the SCL pin.

You can configure i.MX28 pins as GPIOs and toggle them.

~igor

0 Kudos

210 Views
英库李
Contributor I

Hi igor

We had tried that, but the I2C was still not free.

Is there any especial way to recover the Bus for i.MX28?

As far as I know if the Bus is hold by the other devices, rebooting the OS could not recover it.

So there must be something wrong with the i.MX.

When we read or write on the Bus, kill all the processes suddenly, the bus will be down.

And rebooting the OS will recover the Bus

~英

0 Kudos

210 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi 英

what do you mean by "kill all the processes suddenly" ?

Probably processor just hangs, then nothing will help

except reboot.

~igor

0 Kudos

210 Views
saurabh206
Senior Contributor III

Hi,

Send your post to imx community (e.g. i.MX Community ) to get it visible for active members.

Saurabh

0 Kudos