I am trying to write a spi slave device driver for adxl345 accelerometer. Everything worked without error in dmesg but i cant get any data from SPI device. I can get data when i tried on raspberry pi.
I tried to catch the signal saleae logic analyzer but everything was so quiet, no signal.
- So i changed device tree by adding:
compatible = “ti,omap2-mcspi”;
phandle = <0x175>;
compatible = “spidev”;
reg = <0x0>;
#address-cells = <0x1>;
#size-cells = <0x0>;
spi-max-frequency = <0x7a120>;
phandle = <0x998>;
spidev0 = “/ocp/spi@480b8000/spidev@0”;
the node apperared as /dev/spidev3.0
2)Then i made shortcut SOMI and SIMO pins referenced to here:
And i tested device by using spidev_test.c downloaded from here :
[https://raw.githubusercontent.com/raspberrypi/linux/rpi-3.10.y/Documentation/spi/spidev_test.c](https://raw.githubusercontent.com/raspberrypi/linux/rpi-3.10.y/Documentation/spi/spidev_test.c) But it returns only zeroes. What am i missing or doing wrong?