A13-SOM i2c issue - incomplete xfer [SOLVED]

Started by zMax, November 21, 2015, 03:14:08 PM

Previous topic - Next topic

zMax

Hello !

I have an issue with i2c-0, i2c-1, i2c-2 on A13-SOM-256. The bus don't communicate properly. I though first it was because there is an error on my c code (which it work very good on A10-Olinuxino LIME I). But not really because when I used i2cdetect, I got the same error : incomplet xfer (0x20)

Below here is console output :



root@a13-OLinuXino-Micro-SOM:/# i2cdetect 2
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-2.
I will probe address range 0x03-0x77.
Continue? [Y/n] Y
     0  1  2  3  4  5  6  7  8  incomplete xfer (0x20)
[ 8744.710330] incomplete xfer (0x20)
9  a  b  c  d  e  f
00:        incomplete xfer (0x20)
[ 8744.718607] incomplete xfer (0x20)
  -- -- incomplete xfer (0x20)
[ 8744.724802] incomplete xfer (0x20)
-- incomplete xfer (0x20)
[ 8744.731184] incomplete xfer (0x20)
-- incomplete xfer (0x20)
[ 8744.736954] incomplete xfer (0x20)
-- incomplete xfer (0x20)
[ 8744.743658] incomplete xfer (0x20)
-- incomplete xfer (0x20)
[ 8744.749690] incomplete xfer (0x20)
-- incomplete xfer (0x20)
[ 8744.755456] incomplete xfer (0x20)
-- incomplete xfer (0x20)
[ 8744.761954] incomplete xfer (0x20)
-- incomplete xfer (0x20)
[ 8744.767716] incomplete xfer (0x20)
-- incomplete xfer (0x20)
[ 8744.773793] incomplete xfer (0x20)
-- incomplete xfer (0x20)
[ 8744.779771] incomplete xfer (0x20)
-- incomplete xfer (0x20)
[ 8744.785537] incomplete xfer (0x20)
--

and so on ...


also i2cdetect -l properly list existing i2c-n devices.



root@a13-OLinuXino-Micro-SOM:/# i2cdetect -l
i2c-0   i2c             sunxi-i2c.0                             I2C adapter
i2c-1   i2c             sunxi-i2c.1                             I2C adapter
i2c-2   i2c             sunxi-i2c.2                             I2C adapter




I'm using the official Olimex Debian image on µSD card and using A13-SOM-256 + A13-SOM-WIFI.

What wrong ? Kernel error ? Hardware failure ?

I'm thinking to rewrite image 

zMax

#1
Another thing. I captured i2c-2 SDA and SCL output with a logic analyser.
Only the first frame goes out : |S|->|ADDR+WR|->|NAK|  and no response of my device :( (even if the code is good on A10-OlinuXino)


mlyons1340

Why do you use the i2c detect program?  Could you have the wrong address which is why you aren't getting response?  I believe the NAK means your slave isn't responding to the write request which would be indicative of a hardware issue or having the incorrect address.  Do you have the required pullups on your SDA and SCL signals?  What is the frequency of SCL?

zMax

I used i2cdetect to debug and see if everything look normal. i2cdetect send multiple write commands for devices address from 0x03 to 0x77. After that, I guess the software check if there is any ACK responses on the I2C bus for each address. Even if there is no response from any devices or no devices are connected at all, i2cdetect must printed the result like this :



     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --



In my case, i2cdetect and any I2C attempt print back in console incomplet xfer (0x20) ...



root@a13-OLinuXino-Micro-SOM:~# i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] Y
     0  1  2  3  4  5  6  7  8  incomplete xfer (0x20)
[ 8744.710330] incomplete xfer (0x20)
9  a  b  c  d  e  f
00:        incomplete xfer (0x20)
[ 8744.718607] incomplete xfer (0x20)
  -- -- incomplete xfer (0x20)
[ 8744.724802] incomplete xfer (0x20)
-- incomplete xfer (0x20)
[ 8744.731184] incomplete xfer (0x20)
-- incomplete xfer (0x20)
[ 8744.736954] incomplete xfer (0x20)

and so on for any address ...



I properly add pullup resistors to SDA and SCL line. SCL frequency set as default value : 100kHz

zMax

#4
Ok Ok Ok ...  ;D

I got it now. There is no error at all.

I tried i2cdetect with ssh connection and I got what expected to have :



root@a13-OLinuXino-Micro-SOM:~# i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] Y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --                         



My two I2C devices are properly connected and visible by the systems.

The problem wasn't a real one. When I used i2cdetect or any I2C-n software with A13-SOM debug UART-1 connection. The console displayed back other messages that ssh just don't print...

So my bad, I was just so focusing on that damn incomplete xfer messages that I didn't realise that everything work fine since the beginning  ::).

Anyway, thanks for your help.