i2cdump shows all as xx xx xx with adxl345 sensor board.

Hi all,

I have a bbb, and I have interfaced an adxl345 on p9_19 and p9_20.
on i2cdetect -r 2 I can see the chip address 0x53 as SDO is grounded.

When I try to do

root@beaglebone:~# i2cdetect -r 2
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-2 using read byte commands.
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: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – 53 UU UU UU UU – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --

and

i2cdump -y 1 0x53

I see all entries as

root@beaglebone:~# i2cdump -y 1 0x53
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
10: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
20: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
30: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
40: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
50: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
60: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
70: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
80: XX XX XX XX XX XX XX

I am directly connecting 3.3v(p9_3) to 3v3 of adxl and gnd(p9_1) to gnd of adxl. Also I am direclty connecting to p9_19 to scl and p9_20 to sda directly.
I do not have oscilloscope so I can’t check much
what is wrong here?

<https://lh3.googleusercontent.com/-693LAOpBgRg/WdfcmlITSyI/AAAAAAAAGCk/CugmXpLMDM8iFSz578t-5U1Jz6o0GXaEwCLcBGAs/s1600/I0066740226.jpg&gt;

<https://lh3.googleusercontent.com/-zhFDI7kB13I/Wdfb3YShlSI/AAAAAAAAGCc/h8vqN48VdBsjnyvR4ZRrO27RaAF3MHDOQCLcBGAs/s1600/I0643527176.jpg&gt;
Hi all,

I have a bbb, and I have interfaced an adxl345 on p9_19 and p9_20.
on* i2cdetect -r 2* I can see the* chip address 0x53 as SDO is grounded.*

When I try to do

*root@beaglebone:~# i2cdetect -r 2*
*WARNING! This program can confuse your I2C bus, cause data loss and
worse!*
*I will probe file /dev/i2c-2 using read byte commands.*
*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: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --*
*50: -- -- -- 53 UU UU UU UU -- -- -- -- -- -- -- --*
*60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --*
*70: -- -- -- -- -- -- -- --*

and

*i2cdump -y 1 0x53*

Except you just read it on bus 2?

i2cdump -y 2 0x53

I see all entries as

*root@beaglebone:~# i2cdump -y 1 0x53*
*No size specified (using byte-data access)*
* 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef*
*00: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX*
*10: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX*
*20: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX*
*30: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX*
*40: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX*
*50: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX*
*60: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX*
*70: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX*
*80: XX XX XX XX XX XX XX*

I am directly connecting *3.3v(p9_3) to 3v3 of adxl and gnd(p9_1) to gnd
of adxl. Also I am direclty connecting to p9_19 to scl and p9_20 to sda*
directly.
I do not have oscilloscope so I can't check much
* what is wrong here?*

There's a mainline driver for the ADXl345:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/iio/accel/adxl345.txt?h=v4.14-rc3

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/iio/accel/adxl345_i2c.c?h=v4.14-rc3

Just echo:

echo adxl345_i2c 0x53 > /sys/bus/i2c/devices/i2c-1/new_device
or
echo adxl345_i2c 0x53 > /sys/bus/i2c/devices/i2c-2/new_device

Regards,

I was at mistake

I did echo adxl345_i2c 0x53 > /sys/bus/i2c/devices/i2c-2/new_device

in dmesg

[ 110.747301] i2c i2c-2: new_device: Instantiated device adxl345_i2c at 0x53
[ 308.580190] i2c i2c-2: Failed to register i2c client adxl345_i2c at 0x53 (-16)