AnsweredAssumed Answered

imx6q i2c-imx.c 4.6.2 Kernel

Question asked by Pierre LE COZ on Jun 29, 2016
Latest reply on Jul 12, 2016 by Pierre LE COZ


Hi All,


Hi face some trouble using i2c-imx driver. For most devices all looks okay.  However for a specific device the controller seems to get stuck after receiving a ACK.

 

Here is are working example :

I have on the bus a device with address 0x39. I run :

root@lec-imx6:~# i2cdetect -r 1 0x39 0x39

The device is well detected and I get the followings messages :

root@lec-imx6:~# dmesg

[   63.140092] i2c i2c-1: <i2c_imx_xfer>

[   63.140178] i2c i2c-1: <i2c_imx_start>

[   63.140267] i2c i2c-1: <i2c_imx_bus_busy>

[   63.140297] i2c i2c-1: <i2c_imx_xfer> transfer message: 0

[   63.140323] i2c i2c-1: <i2c_imx_read> write slave address: addr=0x39

[   63.140564] i2c i2c-1: <i2c_imx_trx_complete> TRX complete

[   63.140597] i2c i2c-1: <i2c_imx_acked> ACK received

[   63.140623] i2c i2c-1: <i2c_imx_read> setup bus

[   63.140651] i2c i2c-1: <i2c_imx_read> read data

[   63.140841] i2c i2c-1: <i2c_imx_trx_complete> TRX complete

[   63.141019] i2c i2c-1: <i2c_imx_read> clear MSTA

[   63.141071] i2c i2c-1: <i2c_imx_bus_busy>

[   63.141114] i2c i2c-1: <i2c_imx_read> read byte: B0=0x0

[   63.141175] i2c i2c-1: <i2c_imx_xfer> exit with: success msg: 1

 

I see the following signals on the scope :

F0008TEK.BMP

 

 

 

Here is the non-working example :

The device is on the same bus and its address is 0x52. I Run :

root@lec-imx6:~# i2cdetect -r 1 0x52 0x52

That time the device is not detected and I get :

[ 2017.447825] i2c i2c-1: <i2c_imx_xfer>

[ 2017.447914] i2c i2c-1: <i2c_imx_start>

[ 2017.448006] i2c i2c-1: <i2c_imx_bus_busy>

[ 2017.448036] i2c i2c-1: <i2c_imx_xfer> transfer message: 0

[ 2017.448063] i2c i2c-1: <i2c_imx_read> write slave address: addr=0x52

[ 2017.448309] i2c i2c-1: <i2c_imx_trx_complete> TRX complete

[ 2017.448342] i2c i2c-1: <i2c_imx_acked> ACK received

[ 2017.448369] i2c i2c-1: <i2c_imx_read> setup bus

[ 2017.448395] i2c i2c-1: <i2c_imx_read> read data

[ 2017.541216] i2c i2c-1: <i2c_imx_trx_complete> Timeout

[ 2017.541252] i2c i2c-1: <i2c_imx_stop>

[ 2017.541281] i2c i2c-1: <i2c_imx_bus_busy>

[ 2017.541327] i2c i2c-1: <i2c_imx_xfer> exit with: error: -110

 

The signals are the followings :

F0009TEK.BMP

 

We can see that the device sends the ACK has expected. However the controller stops clocking (only 8 cycles instead of 9 expected).

 


 

 

 

 

 

 

 

 

Outcomes