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 :
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 :
We can see that the device sends the ACK has expected. However the controller stops clocking (only 8 cycles instead of 9 expected).
Hi Igor,
I tried with 3.10 kernel build using Yocto and official fsl packages but I still have the same behavior : i2c clock gets stuck high after 8 cycles although the device acked.
I did not tried the nxp Sabre just because I don't have one.
My board is lec-imx6 (quad) :
root@lec-imx6:~# uname -a
Linux lec-imx6 3.10.80-1.1.0_ga+gee98645 #1 SMP Tue Apr 19 21:10:29 CEST 2016 armv7l GNU/Linux
Hi Pierre
latest official nxp L4.1.15 kernel, "L4.1.14" was misprint.
Had you tried with nxp Sabre reference board ?
As stated by our experts on :
https://community.nxp.com/thread/428915
"NXP does not support kernel mainline. Only our BSP versions are guarantee to work."
Best regards
igor
This leads to the timeout error (110).
Any idea how I could solve this ?
Regards,
Pierre
Hi Pierre
seems i2c driver works without issues on latest official nxp L4.1.14 kernel:
i.MX 6 Series Software and Development Tool|NXP
you can check it and try to port to new kernel.
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Igor, thanks for your quick reply!
L4.1.14 you say ?
I actually imported the imx-i2c.c of origin/imx_4.1.15_1.0.0_ga in my kernel.
Although there are few diffs in the imx-i2c.c files, result is the same : I get the 110 error and only 8 clock cycle.
i2cdetect has seen few times the device : it was well detected for some obscure reasons. After some retries, the device was not anymore detected, without any action from my part.
The device is perfectly well detected on an other board : beaglebone (omap).