I have a camera connected to the camera expansion header in the TX2 devkit board. Actually, I’m only interested in the i2c communication. I’m able to get an ack of the camera in the desired address by running:
sudo i2cdetect -y -r 2
· 0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- 36 -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Now, I’d like to read 4 bytes from the slave (e.g. 0x00000001), and the camera should answer 4 bytes too (e.g 0x00ABCD00). I’ve unsuccessfully tried to read it somehow with i2ctransfer. As a side note, the I2C communication with the camera works perfect (debugged it with a I2C host adapter, and I’m able to read/write anything)
Any idea of how can I read something? Data frames are always 4 bytes of address, 4 bytes of data
UPDATE (29/10/2019 16:43 GMT+1)
I achieve to read the values at address 0x00000000 by doing:
sudo i2ctransfer -y 2 w1@0x36 0x00 r4
Anyway, when setting 0x01 instead of 0x00, it reads address 0x01000000, but I am interested in reading 0x00000001. Will update if I can solve it. Any help is appreciated though.
SOLUTION
As ShaneCCC proposed in comment #4, it can be done as follows:
i2ctransfer -f -y 2 w4@0x36 0x00 0x00 0x00 0x01 r4