PINE64
Is SPI Working? - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=4)
+--- Forum: Pine A64 Hardware, Accessories and POT (https://forum.pine64.org/forumdisplay.php?fid=32)
+---- Forum: POT modules (https://forum.pine64.org/forumdisplay.php?fid=8)
+---- Thread: Is SPI Working? (/showthread.php?tid=1297)

Pages: 1 2 3 4 5 6 7


RE: Is SPI Working? - MarkHaysHarris777 - 02-23-2017

(02-23-2017, 03:36 PM)milekium Wrote: any update about spi? I can't see /dev/

This entire thread is an update on SPI.

...  can't see /dev/   !?!

1) open a terminal

2) cd  /dev

3) ls -l |less

... use F and B  to scroll forward and backward through your /dev/ devices;  press q to exit.


RE: Is SPI Working? - milekium - 02-24-2017

Thanks for replay, sorry I didn't explain myself(late night and frustrated).
I install new armbian image and follow the thread as far as my knowledge allow me, but still can't see anything on "ls /dev/spi*", so I guess I missing something or spi just don't work, ???.has anyone use spi with pine64?

I read a forum about CHIP board (also Allwinner chip) and problems with spi (https://bbs.nextthing.co/t/solved-enable-spi-and-uart-on-chip/849/10), they suggest further modifications of dtb, like adding "compatible = "spidev";".. and succeed to make it work. I may try that board.

ok, following this changes:
status = "okay";
pinctrl-0 = <0xa7 0xa8>;
spidev@0 {
compatible = "spidev";
reg = <0x0>;
spi-max-frequency = <0x2faf080>;
};
now I get :
ls /dev/sp*
/dev/spidev0.0
Didn't try if it works, but now I need to celebrate it appears!!


RE: Is SPI Working? - martinayotte - 02-24-2017

With the latest Armbian, /dev/spidevX.X are enabled using overlay. Simply add "overlays=sun8i-h3-spi0-spidev" into /boot/armbianEnv.txt.

And to test if it is actually working, there a piece of code on the net which is named "spidev_test.c" to test loopback of MOSI/MISO.

Example :
Code:
./spidev_test -D /dev/spidev1.0
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)

FF FF FF FF FF FF
40 00 00 00 00 95
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
DE AD BE EF BA AD
F0 0D



RE: Is SPI Working? - milekium - 02-24-2017

Thanks!! It works nice.


RE: Is SPI Working? - xalius - 02-24-2017

Thanks a lot martin, I knew you added an overlay but I missed the name for it...


RE: Is SPI Working? - x893 - 04-05-2017

Hi,
i use PINE64 (512Mb) and Armbian server Debian Jessie 3.10.104
Simply add
overlays=sun50iw1p1-pine64.dtb
to /boot/armbianEnv.txt
but /dev/spi* not presents after reboot.
Can anybody say right way ?

Thanks


RE: Is SPI Working? - xalius - 04-05-2017

Your overlays=... line is a whole devicetree for the Pine64 which already gets loaded for your board, you only need a SPI overlay, see above in martin's post:

overlays=sun8i-h3-spi0-spidev

(A64 shares a lot of the peripherals with H3, it is basically a H3 with upgraded cores...)


RE: Is SPI Working? - x893 - 04-05-2017

Thanks for your reply but unsuccessfull
My /boot/uEnv.txt

console=tty0 console=ttyS0,115200n8 no_console_suspend
kernel_filename=pine64/Image
initrd_filename=initrd.img
ethaddr=36:c9:e3:f1:b8:05
overlays=sun8i-h3-spi0-spidev

also sudo find . -name 'sun8i-h3-spi0-spidev.*' not found this file


RE: Is SPI Working? - xalius - 04-05-2017

Ah I just saw you don't use an Armbian mainline image! I think overlays only work with the mainline kernel images...


RE: Is SPI Working? - x893 - 04-05-2017

i can install any image (i try dietpi, ubuntu) but mainline not available for this board.
https://www.armbian.com/pine64/
previously i use raspberry and no problem with spidev
Looks as nobody use SPI on pine64 Sad